Code for various algorithms, and data structures, C++