Implement data structure using C++