Implementations of various algorithms in Java