Implementing data structures algorithms in rust-lang