Posts

DIVIDE AND CONQUER VS DYNAMIC PROGRAMMING

Image
  In this blog, we will see the similarities and differences between Dynamic Programming and Divide-and-Conquer approaches. Divide-and-Conquer Divide-and-conquer is a technique used for designing algorithms that consist of dividing the problem into smaller subproblems hoping that the solutions of the subproblems are easier to find and then composing the partial solutions into the solution of the original problem.  Divide and Conquer algorithm consists of a dispute using the following three steps Divide  the original problem into a set of subproblems. Conquer:  Solve every subproblem individually, recursively. Combine:  Put together the solutions of the subproblems to get the solution to the whole problem. Dynamic Programming Dynamic Programming is a technique for solving problems with overlapping subproblems. In this, we store the result of the sub-problem that is solved once for future re-use. The technique of storing sub-problem solutions is called memoization. There are two key attr