DataStructure implementation in C++