Algorithms code in C++ and Python for my blog