Playing Java Problems, Algorithms