Implementations of various algorithms in C++