Algorithm implementations in Rust