直接插入排序
来源:互联网 发布:手机数据备份软件 编辑:程序博客网 时间:2024/05/20 02:28
// InsertSort.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include<iostream>void InsertSort(int a[],int n){int i,j;int temp;for (i=1;i<n;i++){temp=a[i];//取出第一个准备插入的数字for(j=i-1;j>=0 && temp<a[j];j--){a[j+1]=a[j];}a[j+1]=temp;//插入数据到序列}}int _tmain(int argc, _TCHAR* argv[]){int a[]={2,3,1,5}; InsertSort(a,4); for (int i=0;i<4;i++) { printf("%3d ",a[i]); } system("pause");return 0;}
- 插入排序--直接插入
- 插入排序------直接插入
- 插入排序---直接插入
- 排序:直接插入排序
- 排序---直接插入排序
- 排序 -- 直接插入排序
- 排序---直接插入排序
- 排序--直接插入排序
- 排序-直接插入排序
- 【排序】直接插入排序
- 排序--直接插入排序
- 排序:直接插入排序
- 【排序】直接插入排序
- 排序--直接插入排序
- 排序--直接插入排序
- 排序-直接插入排序
- 插入排序--直接插入排序
- 插入排序-直接插入排序
- 搜索框根据输入自动提示--js实现
- EnumProcesses函数
- 自由定义eclipse中的各种颜色
- js读写cookie
- 没有针对客户定义销售区域-解决方案
- 直接插入排序
- SurfaceView简单用法一
- youtube视频转发
- 从程序员角度看ELF
- CreateProcess函数
- 设计模式学习--工厂方法模式
- [Android实例] Android 深入解析光传感器(一)
- GetClipboardData函数
- Wireless tools for Linux 的一些资料收集