coursera: algorithm: assignments 4