Programming Assignment from Algorithms and Data Structures (Java)