文件名称:递归算法快速排序
介绍说明--下载内容均来自于网络,请自行研究使用
分而治之方法还可以用于实现另一种完全不同的排序方法,这种排序法称为快速排序(quick sort)。在这种方法中, n 个元素被分成三段(组):左段l e f t,右段r i g h t和中段m i d d l e。中段仅包含一个元素。左段中各元素都小于等于中段元素,右段中各元素都大于等于中段元素。因此l e f t和r i g h t中的元素可以独立排序,并且不必对l e f t和r i g h t的排序结果进行合并。m i d d l e中的元素被称为支点( p i v o t )。图1 4 - 9中给出了快速排序的伪代码-divide-and-rule method can be used to achieve an entirely different sort of way, this sort called Quick Sort (quick sort). In this method, n elements are divided into three (group) : Left of l e f t and the right of g h i r t and middle m i d e d l. The middle contains only one element. Left of the elements are smaller than or equal to the middle element of the right elements are greater than or equal to the middle element. So l e r t and f g h i t element of independent sort, and not on l e r t and f g h i t ranking results merger. M i d e d l of elements called Fulcrum (p i v o t). Figure 1 4-9 is given a quick sort of pseudo-code
(系统自动生成,下载前可以参看下载内容)
下载文件列表
快速排序
........\Project1.cfg
........\Project1.dof
........\Project1.dpr
........\Project1.exe
........\Project1.res
........\Unit1.dcu
........\Unit1.ddp
........\Unit1.dfm
........\Unit1.pas
........\Unit1.~ddp
........\Unit1.~dfm
........\Unit1.~pas
........\Project1.cfg
........\Project1.dof
........\Project1.dpr
........\Project1.exe
........\Project1.res
........\Unit1.dcu
........\Unit1.ddp
........\Unit1.dfm
........\Unit1.pas
........\Unit1.~ddp
........\Unit1.~dfm
........\Unit1.~pas