Coursera stanford algorithm programming assignment#1