// 插入排序 源代码
//插入排序
void InsertSort(int *a,int n)
{
int i=0,j;
for(;++i<n;)
{
for(j=i;--j>=0;)
{
if(a[j+1]<a[j]){
swap(&a[j+1],&a[j]);
}
else
{
break;
}
}
posted on 2017-07-07 19:28 yjbjingcha 阅读(213) 评论(0) 编辑 收藏 举报