Implementing important algorithms in computer science in Java