会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
StanleyWu
博客园
首页
新随笔
联系
订阅
管理
随笔分类 -
算法导论
算法导论chapter2-2.1 Insertion sort
摘要: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
阅读(221)
评论(0)
推荐(0)
公告