Divide and conquer

Also known as: Divide-and-conquer

Divide and conquer solves a problem by splitting into independent subproblems, solving them recursively, then combining results. Classic template: divide, conquer, combine.

Merge sort, quicksort, and binary search are the usual examples. Recurrences such as $T(n) = 2T(n/2) + O(n)$ are solved with the master theorem or recursion trees.

Unlike dynamic programming, pure D&C does not overlap subproblems; if they overlap and you recompute, switch to DP or memoization. Unlike greedy methods, D&C explores whole subtrees of the recursion, not one local choice.

← Back to CS Glossary