For coursera AlgorithmII