Page 1
Wink Notes
B.Tech CSE — 4th Semester
Design and Analysis of Algorithms
— Unit - 2 —
1. The Divide and Conquer Paradigm
Divide and Conquer (D&C) is an elegant, top-down algorithm design paradigm. It tackles massive, complex problems by breaking them down into smaller, identical, and independent subproblems.
1.1 The Three Steps
Every D&C algorithm strictly follows three distinct phases, usually implemented via recursion:
- 1. Divide: Break the original problem of size into several smaller subproblems. (e.g., Slice an array exactly in half).
- 2. Conquer: Solve the subproblems recursively. If the subproblem sizes are small enough (the base case), solve them instantly in constant time.
- 3. Combine: Merge the solutions of the subproblems together to form the final solution to the original large problem.
The elegance of D&C is that the mathematical analysis perfectly mirrors the algorithmic steps. The recurrence relation explicitly represents the Divide and Combine costs as , and the Conquer cost as .