standford algorithm assignment 1