java implementation of popular algorithms