how does the technique of dynamic programming improve the ex
how does the technique of dynamic programming improve the execution time of an recursive algorithm?
Solution
Dynamic programming is a technique for solving problems with overlapping subproblems. Usually, these subproblems arise from a recurrence relating a given problem’s solution to solutions of its smaller subproblems. Rather than solving overlapping subproblems again and again, dynamic programming suggests solving each of the smaller subproblems only once and recording the results in a table from which a solution to the original problem can then be obtained.
And as you are not repeatedly solving the same problem, and instead, storing the result in a table, and accessing it when and where necessary, obviously the time required to solve a problem will be reduced, but at the cost of extra space to store the previous recursion results.
