Course homework for algorithm II