General C++ problems and algorithms