practice important alogrithms in java