An algorithm is a finite, deterministic procedure for solving a class of problems. The study of algorithms asks: is it correct, how fast is it, and can we do better? Every page in this section includes a formal Big O analysis and sources from Cormen et al. CLRS and Knuth TAOCP.
Foundations
Sorting
The most studied class of algorithms. Provably optimal lower bound of Θ(n log n) for comparison sorts.
Comparison table, stability, the Θ(n log n) lower bound proof, and non-comparison sorts. Choose the right algorithm for your data.
Built · Session 09Guaranteed Θ(n log n) in all cases. Divide, conquer, merge. Stable. O(n) space. The algorithm behind Python\'s Timsort and Java object sort.
Built · Session 09 · Θ(n log n) all casesΘ(n log n) average, O(n²) worst case. In-place with O(log n) space. The fastest comparison sort in practice. Introsort, dual-pivot, and partition schemes.
Built · Session 09 · O(log n) spaceΘ(n log n) worst case, O(1) extra space. Not stable. Uses the heap data structure. Guaranteed performance without extra memory.
Coming · Session 10O(n) on nearly-sorted data, O(n²) worst case. Stable, in-place. The best choice for small arrays — used inside Timsort for subarrays ≤ 64.
Coming · Session 10Searching
O(log n) search in a sorted array. Eliminate half the search space per step. The foundation of all divide-and-conquer searching.
Coming · Session 10Depth-first and breadth-first graph traversal. Stack vs. queue. Finding paths, connected components, and cycle detection.
Coming · Session 11Advanced
Solve complex problems by breaking them into overlapping subproblems and storing results. Fibonacci, knapsack, longest common subsequence.
ComingMake locally optimal choices at each step. Dijkstra\'s shortest path, Huffman coding, interval scheduling.
Coming