Dynamic Programming – Problems

Here is the comparison of using memoization and tabulation for the various problems:

ProblemMemoizationTabulationPreferredExplanation
Egg dropping problemO(nk^2)
O(nk) TabulationMemoization has higher time complexity than tabulation due to the recursive nature of the problem. The space complexity of memoization is higher than tabulation as it uses recursion stack.
Binomial CoefficientO(nk) O(nk) EitherBoth memoization and tabulation have the same time and space complexity. Memoization can be preferred for small values of n and k. Tabulation can be preferred for larger values of n and k as it is an iterative approach.
Rod cutting problemO(n^2) O(n^2) EitherBoth memoization and tabulation have the same time and space complexity. Either approach can be preferred as per the preference of the programmer.
Subset SumO(nW) O(nW) EitherBoth memoization and tabulation have the same time and space complexity. Either approach can be preferred as per the preference of the programmer.
Coin Change ProblemO(nm) O(nm) EitherBoth memoization and tabulation have the same time and space complexity. Either approach can be preferred as per the preference of the programmer.
Palindrome partitioningO(n^3) O(n^2) TabulationMemoization has a higher time complexity than tabulation due to the recursive nature of the problem. The space complexity of memoization is higher than tabulation as it uses recursion stack.
Longest Increasing SubsequenceO(n^2) O(n) TabulationMemoization has higher time complexity than tabulation due to the recursive nature of the problem. The space complexity of memoization is higher than tabulation as it uses recursion stack.
Word break problemO(n^3) O(n^2) TabulationMemoization has a higher time complexity than tabulation due to the recursive nature of the problem. The space complexity of memoization is higher than tabulation as it uses recursion stack.
Partition problemO(n^2S) O(n^2S) EitherBoth memoization and tabulation have the same time and space complexity. Either approach can be preferred as per the preference of the programmer.
Maximum bipartite matchingO(mn^2) O(mn) TabulationMemoization has a higher time complexity than tabulation due to the recursive nature of the problem. The space complexity of memoization is higher than tabulation as it uses recursion stack.
Bin packing problemO(nW) O(nW) EitherBoth memoization and tabulation have the same time and space complexity. Either approach can be preferred as per the preference of the programmer.
Edit DistanceO(mn) O(mn) EitherBoth memoization and tabulation