Algorithm Review
banner
algorithmreview.bsky.social
Algorithm Review
@algorithmreview.bsky.social
Helpful posts about computer science algorithms, data structures, and more. Please DM any corrections.
Knapsack Problem (0/1) is a dynamic programming algorithm for solving the knapsack problem that determines the maximum value that can be obtained without exceeding the weight capacity.

• Time complexity: O(nW)
• Space complexity: O(nW)

#AlgorithmReview
January 17, 2026 at 1:43 PM
Selection sort is a simple comparison-based sorting algorithm that repeatedly selects the minimum element from the unsorted part and moves it to the sorted part.

• Time complexity: O(n^2)
• Space complexity: O(1)

#AlgorithmReview
January 16, 2026 at 1:48 PM
Knapsack Problem (0/1) is a dynamic programming algorithm for solving the knapsack problem that determines the maximum value that can be obtained without exceeding the weight capacity.

• Time complexity: O(nW)
• Space complexity: O(nW)

#AlgorithmReview
January 15, 2026 at 1:50 PM
Dijkstra's Algorithm is an algorithm for finding the shortest paths between nodes in a graph that maintains a priority queue to explore the shortest known distance to each vertex.

• Time complexity: O((V + E) log V)
• Space complexity: O(V)

#AlgorithmReview
January 14, 2026 at 1:49 PM
Depth-First Search (DFS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking.

• Time complexity: O(V + E)
• Space complexity: O(V) but may vary depending on implementation

#AlgorithmReview
January 13, 2026 at 1:50 PM
Shell sort is an optimization over insertion sort that sorts elements far apart from each other and progressively reduces the gap between elements to be compared.

• Time complexity: O(n log n) to O(n^2) depending on gap sequence
• Space complexity: O(1)

#AlgorithmReview
January 12, 2026 at 1:50 PM
Radix sort is a non-comparative integer sorting algorithm that processes individual digits of numbers, starting from the least significant digit to the most significant.

• Time complexity: O(d * (n + k))
• Space complexity: O(n + k)

#AlgorithmReview
January 11, 2026 at 1:43 PM
Bucket sort is a distribution sort that works well when input is uniformly distributed that divides the elements into several buckets, sorts each bucket, and then merges them.

• Time complexity: O(n + k)
• Space complexity: O(n + k)

#AlgorithmReview
January 10, 2026 at 1:43 PM
Breadth-First Search (BFS) is a graph traversal algorithm that explores all neighbors at the current depth before moving on to nodes at the next depth level.

• Time complexity: O(V + E)
• Space complexity: O(V)

#AlgorithmReview
January 9, 2026 at 1:48 PM
Knapsack Problem (0/1) is a dynamic programming algorithm for solving the knapsack problem that determines the maximum value that can be obtained without exceeding the weight capacity.

• Time complexity: O(nW)
• Space complexity: O(nW)

#AlgorithmReview
January 8, 2026 at 1:50 PM
Heap sort (in-place) is a comparison-based sorting algorithm using a binary heap data structure that repeatedly removes the root (largest or smallest element depending on the heap type) and maintains the heap property.

• Time complexity: O(n log n)
• Space complexity: O(1)

#AlgorithmReview
January 7, 2026 at 1:49 PM
Counting sort is a non-comparison-based sorting algorithm suitable for small, non-negative integer ranges that counts the occurrences of each element and uses this information to place elements in the correct position.

• Time complexity: O(n + k)
• Space complexity: O(k)

#AlgorithmReview
January 6, 2026 at 1:48 PM
Depth-First Search (DFS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking.

• Time complexity: O(V + E)
• Space complexity: O(V) but may vary depending on implementation

#AlgorithmReview
January 5, 2026 at 1:50 PM
Merge sort is an efficient, stable, divide-and-conquer sorting algorithm that recursively divides the list into halves, sorts each half, and merges them back together.

• Time complexity: O(n log n)
• Space complexity: O(n)

#AlgorithmReview
January 4, 2026 at 1:43 PM
Floyd-Warshall is an algorithm for finding shortest paths in a weighted graph with positive or negative edge weights that uses dynamic programming to update the shortest paths between all pairs of vertices.

• Time complexity: O(V^3)
• Space complexity: O(V^2)

#AlgorithmReview
January 3, 2026 at 1:42 PM
Heap sort (in-place) is a comparison-based sorting algorithm using a binary heap data structure that repeatedly removes the root (largest or smallest element depending on the heap type) and maintains the heap property.

• Time complexity: O(n log n)
• Space complexity: O(1)

#AlgorithmReview
January 2, 2026 at 1:45 PM
Shell sort is an optimization over insertion sort that sorts elements far apart from each other and progressively reduces the gap between elements to be compared.

• Time complexity: O(n log n) to O(n^2) depending on gap sequence
• Space complexity: O(1)

#AlgorithmReview
January 1, 2026 at 1:46 PM
Heap sort (in-place) is a comparison-based sorting algorithm using a binary heap data structure that repeatedly removes the root (largest or smallest element depending on the heap type) and maintains the heap property.

• Time complexity: O(n log n)
• Space complexity: O(1)

#AlgorithmReview
December 31, 2025 at 1:45 PM
Merge sort is an efficient, stable, divide-and-conquer sorting algorithm that recursively divides the list into halves, sorts each half, and merges them back together.

• Time complexity: O(n log n)
• Space complexity: O(n)

#AlgorithmReview
December 30, 2025 at 1:47 PM
Knapsack Problem (0/1) is a dynamic programming algorithm for solving the knapsack problem that determines the maximum value that can be obtained without exceeding the weight capacity.

• Time complexity: O(nW)
• Space complexity: O(nW)

#AlgorithmReview
December 29, 2025 at 1:48 PM
Insertion sort is a simple sorting algorithm suitable for small datasets that builds the final sorted array one item at a time, inserting elements into their correct position.

• Time complexity: O(n^2)
• Space complexity: O(1)

#AlgorithmReview
December 28, 2025 at 1:43 PM
Bucket sort is a distribution sort that works well when input is uniformly distributed that divides the elements into several buckets, sorts each bucket, and then merges them.

• Time complexity: O(n + k)
• Space complexity: O(n + k)

#AlgorithmReview
December 27, 2025 at 1:42 PM
Knapsack Problem (0/1) is a dynamic programming algorithm for solving the knapsack problem that determines the maximum value that can be obtained without exceeding the weight capacity.

• Time complexity: O(nW)
• Space complexity: O(nW)

#AlgorithmReview
December 26, 2025 at 1:46 PM
Dijkstra's Algorithm is an algorithm for finding the shortest paths between nodes in a graph that maintains a priority queue to explore the shortest known distance to each vertex.

• Time complexity: O((V + E) log V)
• Space complexity: O(V)

#AlgorithmReview
December 25, 2025 at 1:45 PM
Radix sort is a non-comparative integer sorting algorithm that processes individual digits of numbers, starting from the least significant digit to the most significant.

• Time complexity: O(d * (n + k))
• Space complexity: O(n + k)

#AlgorithmReview
December 24, 2025 at 1:45 PM