摘要: 2.1 Insertion sort Insertion Sort#include <iostream>using namespace std;int main(){ int a[]={5,2,4,6,1,3}; int n=5; for (int j=1;j<=n;++j) { int key=a[j]; int i=j-1; while (( i >= 0)&& (a[i]>key)) { a[i+1]=a[i]; --i; } a... 阅读全文
posted @ 2013-06-05 16:19 StanleyWu 阅读(211) 评论(0) 推荐(0) 编辑