Source: https://www.rose-hulman.edu/class/cs/archive/other-old/most_of_OLD_from_CSSE232-Fall-2011/0506a/www/Resources/Current Exams/0506aExam1-solns.pdf