Implement classic algorithms in Java.