Java code for course https://www.coursera.org/course/algo2