C++ Data structures and algorithem