Add dynamic-programming module: ten classic DP problems, memoization vs tabulation vs space-optimised, call-count and pitfall transcripts (11 tests)

This commit is contained in:
2026-11-09 08:41:01 +00:00
parent 911aef5515
commit cb1b28682f
33 changed files with 1551 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
Longest Increasing Subsequence: [10, 9, 2, 5, 3, 7, 101, 18]
============================================================
a[i] [10, 9, 2, 5, 3, 7, 101, 18]
dp[i] [1, 1, 1, 2, 2, 3, 4, 4] (dp[i] = longest increasing subsequence ENDING at index i)
answer = max(dp) = 4 (for example 2, 3, 7, 18)
O(n log n) patience version = 4