← Algorithm Design learning pathAlgorithm Design · Module 2 of 10
Divide and conquer
Split problems, solve parts and combine.
📖 Key ideas
- Divide the problem into smaller subproblems.
- Conquer each recursively.
- Combine results.
- Examples: merge sort, quick sort, binary search, Strassen's matrix multiplication.
- Often gives O(n log n) solutions.
💡 Real-life example: Divide and conquer is cleaning a house room by room, then the whole house is clean.
DivideSplit into subproblems
ConquerSolve subproblems recursively
CombineMerge sub-results
Merge sortDivide-and-conquer sort