Algos in Java