algo exam 2013-2014 ex4 question 1