摘要:
http://c.chinaitlab.com/special/cpxsf/index.html1. 插入排序(Insertion Sort)算法的复杂度也是简单的,排序第一个需要1的复杂度,排序第二个需要2的复杂度,因此整个的复杂度就是 1 + 2 + 3 + …… + N = O(N ^ 2)的复杂度。//插入排序voidInsertSort(intarray[],intlength){ inti,j,key; for(i=1;i=0&&array[j]>key;j--) { array[j+1]=array[j]; } //... 阅读全文
posted @ 2012-04-18 15:31
higirle
阅读(236)
评论(0)
推荐(0)
浙公网安备 33010602011771号