Algorithms and data structures in java