Algorithms in C++