Learning data structures in C++