Basic Algorithms Implemented in Java