Various Algorithms and Data Structures in C++ and Java