
排序算法
lxchenjun
QQ:110401920
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
不一样的冒泡排序
排序思路:循环取出最大值放在数组的最后,最小值放到最前。上代码:void bubbleSort5(int[] arr){ //设置数组左右边界 int left = 0, right = arr.Length; int min ,max; int x1 = 0, x2 = 0; int t1 = 0, t2 = 0; //当左右边...原创 2019-04-01 15:13:56 · 135 阅读 · 0 评论 -
插入排序整理
插入排序的思路:从第2个数开始,依次循环把后一个数插入到前面已排序序列中。上代码://1.无哨兵版void InsertSort1(int[] arr,int nLength){ //检测数组 if(arr == null || nLength <=0) return; int i; int j; int temp; ...原创 2019-04-02 21:53:07 · 139 阅读 · 0 评论