Some algorithms with unit tests in C++