Algorithms and data structures in c++