Skip to content

Commit 3846005

Browse files
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 simulation
1 parent 6b0fd3b commit 3846005

2 files changed

Lines changed: 394 additions & 0 deletions

File tree

DIRECTORY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
* [K Folds](https://github.com/TheAlgorithms/R/blob/HEAD/data_preprocessing/k_folds.r)
3434
* [Lasso](https://github.com/TheAlgorithms/R/blob/HEAD/data_preprocessing/lasso.r)
3535

36+
## Dynamic Programming
37+
* [Longest Common Subsequence](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/longest_common_subsequence.r)
38+
3639
## Mathematics
3740
* [Amicable Numbers](https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/amicable_numbers.r)
3841
* [Armstrong Number](https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/armstrong_number.r)

0 commit comments

Comments
 (0)