InsertionSort
来源:互联网 发布:情义我心知解析 编辑:程序博客网 时间:2024/06/05 10:07
//insertion-sort//input a[10]//output a[10](ASC sequence)//////////////////////////////////////////////////////////////////////////#include "stdafx.h"#include<iostream>using namespace std;void InsertSort(int *a, int len){for(int i=1;i<len;i++){while(a[i]<a[i-1]&& i>0){swap(a[i],a[i-1]);//系统函数,对a[i]和a[i-1]中的数据进行交换i--;}}}void main(){int a[10]={1,2,5,6,3,2,6,6,8,4};int len=sizeof(a)/sizeof(a[0]);InsertSort(a,len);for(int i=0;i<len;i++)cout<<a[i]<<" ";getchar();}
- InsertionSort
- InsertionSort
- insertionsort
- InsertionSort
- Insertionsort
- insertionSort
- InsertionSort
- insertionSort debug
- 插入排序(InsertionSort)
- QuickSort & MergeSort & InsertionSort
- 插入算法-insertionsort
- leetcode InsertionSort list
- 插入排序 - InsertionSort
- Chapter 2-InsertionSort
- 插入排序insertionSort
- insertionSort()插入排序
- 插入排序(InsertionSort)
- 算法基础复习-InsertionSort
- 自定义ckeditor编辑器的工具样式
- 用cellspacing实现细线表格
- Java Socket编程关键代码详解
- 视频封装格式(容器)详解
- 集信プログラムの完了コード
- InsertionSort
- Java容器研究总结
- 配信プログラムの完了コード
- sizeof用法分析
- 基于MMX指令集的程序设计简介
- bollean
- vs2008发布失败完美解决方案
- 嵌入式Linux操作系统学习规划
- システム関連の完了コード