Recursion: Divide and Conquer
How does Divide and Conquer work?
A divide-and-conquer algorithm works by recursively breaking the problem down into two or more subproblems of the same or related type, until these subproblems become simple enough to be solved directly. Then one combines the results of subproblems to form the final solution.
What are two examples of Divide and Conquer algorithms?
Merge Sort Quick Sort
What are the general steps to implement Divide and Conquer?
There are in general three steps that one can follow in order to solve the problem in a divide-and-conquer manner. 1. Divide. Divide the problem {S}S into a set of subproblems: \{S_1, S_2, ... S_n\}{S1,S2,...Sn} where {n \geq 2}n≥2, i.e. there are usually more than one subproblem. 2. Conquer. Solve each subproblem recursively. 3. Combine. Combine the results of each subproblem.