Introduction to The Design and Analysis of Algorithms (1)
最近两周看了这本书的第一章和第二章,摘抄书中部分句子做个小总结。 1. 如果一个排序算法保留了等值元素在输入中的相对顺序,就可以说它是稳定的(stable). 例 习题1.3 1 算法 comparisonCountingSort(A[0...n-1]) // 对数组排序 for i <- 0 to n-1 do count[i] <- 0 f
原创
2016-03-07 21:44:54 ·
908 阅读 ·
0 评论