c++ codes and algorithms for some of the most common problems