dsalgo 0.3.10

A package for Datastructures and Algorithms.
Documentation
1
2
3
4
5
pub fn toposort(labels: Vec<usize>) -> Vec<usize> {
    let k = *labels.iter().max().unwrap();

    labels.into_iter().map(|l| k - l).collect()
}