Cpp implementation of different collection data structures