pofk_algorithm 0.0.3

A collection of efficient algorithms implemented in Rust for real-world projects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use pofk_algorithm::dp_algorithms::longest_common_subsequence::longest_common_subsequence;

#[test]
fn test_lcs_large() {
    let a: Vec<u8> = (0..100).collect();
    let b: Vec<u8> = (50..150).collect();
    assert_eq!(longest_common_subsequence(&a, &b), 50);
    let a = b"AGGTAB".to_vec();
    let b = b"GXTXAYB".to_vec();
    assert_eq!(longest_common_subsequence(&a, &b), 4);
}