algorithm analysis cos 226 815860