INSERTION SORT ALGORITHIM
来源:互联网 发布:淘宝客服周总结怎么写 编辑:程序博客网 时间:2024/05/17 01:10
最近在边看算法导论,自己试着学一下C语言,今天调了满久才调出第一个程序,不管程序的写得怎样,总算得出正确的结果
呵呵.....小记一下,fighting!
#include<stdio.h>
main()
{
static int a[7]={5,2,6,1,3,0,4};
int i,j,temp,key;
for (i=1;i<=6;i++)
{
key=a[i];
for(j=i-1;j>=0;j--)
{
if(key<a[j])
{
temp=a[j];
a[j]=a[i];
a[i]=temp;
i--;
}
}
}
printf("the result is ");
for(i=0;i<=6;i++)
{
printf("%d",a[i]);
}
return 0;
}
- INSERTION SORT ALGORITHIM
- Insertion Sort
- Insertion Sort
- insertion sort
- insertion sort
- Insertion Sort
- insertion sort
- insertion sort
- insertion sort
- insertion sort
- Insertion Sort
- Insertion Sort
- Insertion-sort
- Insertion sort
- Insertion sort
- insertion sort
- Insertion sort
- Insertion sort
- 如何优化java代码
- 飞翔,还是飞翔!!?
- 《美丽的京剧》——市场调研
- 多态的概念和作用
- 测试流程的引入
- INSERTION SORT ALGORITHIM
- 简单抓取JPG和PDF上的文字
- asp.net程序中最常用的三十三种编程代码
- AjaxPro for .net 基础例子
- 找工作经历
- stonecai--java中文乱码解决方法
- 测试blog.
- 删病毒“熊猫烧香”setup.exe,spoclsv.exe,ThankYou.exe等等
- 无边框窗口实现拖拉效果