Implementation of Algorithms in Java