Divide and Conquer Method | Dynamic Programming |
---|
1.It deals (involves) three steps at each level of recursion: Divide the problem into a number of subproblems. Conquer the subproblems by solving them recursively. Combine the solution to the subproblems into the solution for original subproblems. | 1.It involves the sequence of four steps:- Characterize the structure of optimal solutions.
- Recursively defines the values of optimal solutions.
- Compute the value of optimal solutions in a Bottom-up minimum.
- Construct an Optimal Solution from computed information.
|
2. It is Recursive. | 2. It is non Recursive. |
3. It does more work on subproblems and hence has more time consumption. | 3. It solves subproblems only once and then stores in the table. |
4. It is a top-down approach. | 4. It is a Bottom-up approach. |
5. In this subproblems are independent of each other. | 5. In this subproblems are interdependent. |
6. For example: Merge Sort & Binary Search etc. | 6. For example: Matrix Multiplication. |