🧮Divide and Conquer
Also known as Divide-and-Conquer Algorithm
Cutting a big problem into small ones like it. Solve each, then join the answers.
Think of it like
Think of it like cleaning a big house. Split it into rooms, clean each, and the house is done.
Example
Lucy's merge sort splits 1,000 names into halves, then quarters, down to single names. Joining them back gives one sorted list.
Why it matters
It turns many slow O(n²) problems into fast O(n log n) ones.
Definition
Common mistake
Key takeaways
- 1Split. Into smaller copies.
- 2Solve each. Often by splitting again.
- 3Join. The answers into one.