摘要:
听了MIT的《Introduction to Algorithm》真是着迷,这里把讲过的伪代码中关于排序的实现了,总结在下边1.插入排序,n方的复杂度void insertion_sort(int arr[])
{ for(int j = 1; j = 0 && key < arr[i]) { arr[i+1] = arr[i]; i--; } arr[i+1] = key; }
}2.合并排序,nlog2n复杂度,代码未写 阅读全文
posted @ 2012-03-14 21:17
赵乐ACM
阅读(145)
评论(0)
推荐(0)