Divide and Conquer Algorithm Design Method
Divide and Conquer Algorithm Design Method
1.1
Steps
1. Divide the problem into smaller problems that are instances of the
same type
2. Conquer the sub problem by solving them recursively. But, if the
sub problems are small enough, just solve them in a straight forward
manner
3. Combine the solutions to the subproblems into the solution for the
original problem.
Generally, a recursive algorithm works by calling itself on smaller instances of the problem.
1. The algorithm is generally made of the 3 steps described above.
2. It receives a set of input
3. It divides the set of input into 2 and calls itself on those 2
4. Each of the subproblems in 3) is again solved from step 2)
Any subproblem that is divisible by the algorithm into subproblems is
called a recursive case.
Any subproblem that is simple enough or not divisble into a smaller
problem is called a base case, and base cases are solved in a straight
forward way
5. The algorithm then combines the solved base cases into solutions and
groups them by their subproblem units. Lets now call them sub solutions. Since the original subproblems were children of a large subproblem, the solutions will belong to parent groups. The assemblage
continues until 2 solution units are obtained. The last 2 solution units
are combined to form a single solution to the original problem.
Another way of looking at the divide and conquer paradigm is as such:
For sorting
1.2
Recurrences
1.3
1.4
Notes on Recurrences