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
12
13
use pofk_algorithm::matrix_algorithms::path_sum::*;

#[test]
fn test_path_sum_true() {
    let grid = vec![vec![5,4,8], vec![11,13,4], vec![7,2,1]];
    assert!(path_sum(&grid, (0,0), (2,2), 27));
}

#[test]
fn test_path_sum_false() {
    let grid = vec![vec![5,4,8], vec![11,13,4], vec![7,2,1]];
    assert!(!path_sum(&grid, (0,0), (2,2), 10));
}