文件名称:Quicksort
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:5.42kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
快速排序算法基本思想
通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列。一般设置数组的第一个数为需要比较的值,把整个数组分为小于和大于该数的两部分。
我自己在写这个算法的时候,卡住了好几回,总是边界值出现问题。下面的这个实现加入了注释,希望对你能够有所帮助。-Basic idea of quick sort algorithm to sort through the trip sort of data will be separated into two independent parts, a part of all of the data than another to be a small part of all of the data, and then part of the data here are two methods for rapid sequencing , the sorting process can be recursive, thus achieving the data into an orderly sequence. The first general set of the array for the need to compare the number of values, the entire array is divided into less than and greater than the number of two parts. I write this algorithm in time, stuck several times, always boundary value problems. The following comments added to this realization, I hope you can help.
通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列。一般设置数组的第一个数为需要比较的值,把整个数组分为小于和大于该数的两部分。
我自己在写这个算法的时候,卡住了好几回,总是边界值出现问题。下面的这个实现加入了注释,希望对你能够有所帮助。-Basic idea of quick sort algorithm to sort through the trip sort of data will be separated into two independent parts, a part of all of the data than another to be a small part of all of the data, and then part of the data here are two methods for rapid sequencing , the sorting process can be recursive, thus achieving the data into an orderly sequence. The first general set of the array for the need to compare the number of values, the entire array is divided into less than and greater than the number of two parts. I write this algorithm in time, stuck several times, always boundary value problems. The following comments added to this realization, I hope you can help.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Quicksort.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.