Divide & Conquer
Loading visualizer…
Divide
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Divide & Conquer
Loading visualizer…
Divide
Break a problem into smaller subproblems, solve each recursively, then combine results. The recursion tree makes the structure impossible to miss.
Watch the recursive split tree grow downward, then see sorted subarrays merge back up level by level.
O(n log n)O(n)Split & MergeSee each comparison as a branch in a decision tree — left for smaller, right for larger, until found or eliminated.
O(log n)O(log n)HalvingStep through all 7 sub-matrix multiplications that replace the naive 8, and watch the result matrix assemble.
O(n^2.807)O(n²)7-MultiplyGeometric D&C: divide the point set by a vertical line, recurse on halves, then check the δ-wide strip for cross-half pairs.
O(n log n)O(n)Geometric D&CHalving the problem each level gives O(log n) levels of recursion — the key to efficient algorithms like merge sort and binary search.
Independent subproblems can run in parallel. Merge sort, FFT, and matrix mult all exploit this for hardware-level speedups.
T(n) = aT(n/b) + f(n) — one formula governs complexity for all D&C algorithms. Understanding the pattern unlocks analysis instantly.