Algorithms and data structures implementation in Java