Angad Sandhu
Search
Browse
On this page

Dynamic Programming

Dynamic Programming

Collection of overlaping sub-problems

Factors affecting DP

    1. Overlapping sub-problems
    1. Memorization [1-D Array]
    1. Tabulation [2-D Array]

Memorization

Here we have the computed values of sub-problems in an Array till n-1 sub problem and use that to calculate nth sub-problem.

Problems that use this : Fibonacci numbers, Longest Common Subsequence,

Tabulation

Here we have the computed values of sub-problems in a Matrix till (n x n-1) sub problem and use that to calculate (n x n)th sub-problem.

Browse the library