CSharp Algorithm - QuickSort
来源:互联网 发布:云计算与应用就业前景 编辑:程序博客网 时间:2024/06/05 15:27
/*
Author: Jiangong SUN
*/
Here I want to explain how to implement "Quick Sort" algorithm in CSharp.
The principle consists of several steps:
1) Get the middle position of an array or list, the list is splitted into two parts
2) Get the first element who is larger than the middle value in the left part, and get the first element who is smaller than middle value in right part, then swap them.
3) Move left variable to right and right variable to left.
4) Call quick sort method recursively
The implementation of quick sort algorithm.
Call the methods.
The results:
I hope this post will do help to you. Enjoy coding!
reference:
http://snipd.net/quicksort-in-c
http://blog.bossma.cn/csharp/csharp_sort_quicksort/
http://www.kirupa.com/forum/showthread.php?241040-C-QuickSort
http://en.wikipedia.org/wiki/Quicksort
http://www.sorting-algorithms.com/
- CSharp Algorithm - QuickSort
- Quicksort Algorithm
- Csharp Algorithm - Bubble Sort
- CSharp Algorithm - Shell sort
- Dual-Pivot Quicksort algorithm
- Algorithm——QuickSort
- Sorting Algorithm:Bubble+QuickSort+Heapsort
- Algorithm——Quicksort(快速排序)
- CSharp Algorithm - Replace multiplication operator with a method
- Week2 Assignment - Quicksort - Stanford - Algorithm: Design and Analysis Part I
- Introduction to Algorithm - Summary of Chapter 7 - Quicksort
- 一个快速排序的实现 An Algorithm for QuickSort
- csharp
- Csharp
- Quicksort
- QuickSort
- quicksort
- quicksort
- Permutations II
- extjs store
- 全面创新:酷我音乐2013年5月14日正式版全面上线,抢先试用
- 2013UUSee与百度开放平台合作 开启互赢新战略
- ACM_调试技巧(不定期更新)
- CSharp Algorithm - QuickSort
- ASP.NET 禁用页面缓存
- Best Time to Buy and Sell Stock II
- 数字万用表二极管档测试原理与使用方法--平顶山焦化公司王水成1999年
- securityCRT 中文乱码
- Csharp Algorithm - Bubble Sort
- 存在bug<java.lang.NoSuchFieldException: DEFAULT_PARAM>
- CSharp Algorithm - Recursive method (Iterate all directories and files in a directory)
- gunzip 和 unzip 解压文件到指定的目录