Data Structure Implementation in C++