
Algorithm
文章平均质量分 66
alldoc
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C# shell排序
shell排序/// /// shell sort /// /// 待排序数组 /// 移动元素次数 public static void ShellSort(ref int[] dest, ref int swapTimes) { for(int delta = dest.Length / 2; delta >= 0; delta /= 2) { if(delt转载 2006-07-18 15:54:00 · 604 阅读 · 0 评论 -
C# 快速排序
快速排序public static void QuickSort(ref int[] dest, int beg, int end, ref int swapTimes) { if(beg >= end) return; int pivot = (beg + end) / 2; Swap.Swaper(ref dest[pivot], ref dest[end]); i转载 2006-07-18 15:56:00 · 479 阅读 · 0 评论 -
C# 插入排序
插入排序/// /// 原始插入排序 /// /// 目标数组 /// 交换次数 public static void InsertSort(ref int[] dest, ref int swapTimes) { //其实根本没必要一个dest.length数组,使得空间复杂度增大 //只需一个int零时变量即可,当前要排序的元素腾出即可 ArrayList de转载 2006-07-18 14:40:00 · 608 阅读 · 0 评论 -
C# 两路归并排序
两路归并排序/// /// 对目标数组进行归并排序 /// 与QuickSort的分治比较,感受递归 /// /// 目标数组 /// 暂存数组 /// 当前部分左位置 /// 当前部分右位置 /// 当前部分中间位置 public static void TwoWayMergeSort(int[] dest, int[] tempDest, int left, int原创 2006-07-18 16:13:00 · 653 阅读 · 0 评论