Algorithms Coursera course - Programming Assignment 3