Divide and Conquer
noun
say it: “dih-VYD and KONG-ker” /dɪˈvaɪd ənd ˈkɑːŋkɚ/
Solving a problem by cutting it into smaller copies of itself, solving each one, and combining the answers.
What is divide and conquer?
Divide and conquer solves a problem by cutting it into smaller copies of the same problem, solving each one the same way, and combining the answers. Merge sort and quicksort both work this way, and so does binary search, which keeps only one half each time. It usually turns into recursion in code.
In a sentence
- “Merge sort is divide and conquer: split the list, sort the halves, merge them back.”
Level: Journeyman · More Data Structures terms at this level
Updated