Algorithms from COMP 3804 class written in java