(C#)插入排序 Insertion Sort
来源:互联网 发布:电脑用手机网络 编辑:程序博客网 时间:2024/05/16 01:03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Sort{ class Insert { public static void InsertSort(List<int> list) { int tmp, j; for (int i = 1; i < list.Count; ++i) { if (list[i] < list[i - 1]) { tmp = list[i]; for (j = i - 1; j >= 0 && tmp < list[j]; --j) { list[j + 1] = list[j]; } //for (j = i - 1; j >= 0;) //{ // if (tmp < list[j]) // { // list[j + 1] = list[j]; // --j; // } // else // { // break; // } //} list[j + 1] = tmp; } } } }}
- (C#)插入排序 Insertion Sort
- [C++] 插入排序法 (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
- (C#)冒泡排序 Bubble Sort
- Exception日志
- 写写自己的vector
- (C#)选择排序 Selection Sort
- C++对象模型笔记(一) C++对象
- (C#)插入排序 Insertion Sort
- GetMessage与PeekMessage的区别
- 人工智能学习
- (C#)快速排序 Quicksort
- Computer Vision 牛人
- 科研需要知道的一些网址
- SetWindowOrg SetViewportOrg DC 的坐标
- DB2 load表没有加nonrecoverable可能引起的问题
- java高新技术视频学习3