Algorithms and concepts in Java