Some useful algorithms written in C++ witout classes (good) and C++11 features (bad)