This is C++ code for data structure and algorithm