Some C++ code for algorithm study