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:
@@ -0,0 +1,16 @@
|
||||
Edit Distance: "kitten" -> "sitting"
|
||||
====================================
|
||||
|
||||
- s i t t i n g
|
||||
- 0 1 2 3 4 5 6 7
|
||||
k 1 1 2 3 4 5 6 7
|
||||
i 2 2 1 2 3 4 5 6
|
||||
t 3 3 2 1 2 3 4 5
|
||||
t 4 4 3 2 1 2 3 4
|
||||
e 5 5 4 3 2 2 3 4
|
||||
n 6 6 5 4 3 3 2 3
|
||||
|
||||
answer = 3 (k->s, e->i, insert g)
|
||||
two-row version = 3
|
||||
horse -> ros = 3
|
||||
intention -> execution = 5
|
||||
Reference in New Issue
Block a user