Algorithms in Java