Commit 3846005
committed
Add Longest Common Subsequence (LCS) dynamic programming algorithm
- Implement complete LCS solution with O(m*n) time complexity
- Include space-optimized O(min(m,n)) version for large inputs
- Add path reconstruction to return actual LCS string
- Support for both string and array sequences
- Multiple LCS finding for cases with multiple solutions
- Create new Dynamic Programming category
- Comprehensive examples including DNA analysis and file diff simulation1 parent 6b0fd3b commit 3846005
2 files changed
Lines changed: 394 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
0 commit comments