Divide and Conquer

What is?

Divide and Conquer Algorithm is a problem-solving technique used to solve problems by dividing the main problem into subproblems, solving them individually and then merging them to find solution to the original problem. In the divide-and-conquer method, if the problem is small enough the base case you just solve it directly without recursing. Otherwise the recursive case you perform three characteristic steps:

  • Divide the problem into one or more subproblems that are smaller instances of the same problem.
  • Conquer the subproblems by solving them recursively
  • Combine the subproblem solutions to form a solution to the original problem.