Implementations of different Data Structures in Java and C++