Some C++ algorithms for learning purposes