文件名称:FastQuery
介绍说明--下载内容均来自于网络,请自行研究使用
/*快速排序采用分治算法,将所需要排序的内容从文件读入放入数组a[p:r],按以下三个步骤进行排序
以a[p]为基准元素将数组分为三段,将大于基准元素的放到后面的单元,小的放到前面的单元,
再用递归对a[p:q-1],a[q+1:r]进行排序,最后合并
时间复杂度:最坏时间复杂度:O(n2)
平均时间复杂度:O(nlogn)
*/-/* Quick sort algorithm using sub-rule will be needed to sort the contents read from the file Add the array a [p: r], according to the following three steps to sort a [p] as the base element to the array is divided into three sections , will be greater than the base element on the back of the unit, put in front of a small unit, and then recursively to a [p: q-1], a [q+ 1: r] sort, the last time complexity of the merger degree: the worst time complexity: O (n2) the average time complexity: O (nlogn)* /
以a[p]为基准元素将数组分为三段,将大于基准元素的放到后面的单元,小的放到前面的单元,
再用递归对a[p:q-1],a[q+1:r]进行排序,最后合并
时间复杂度:最坏时间复杂度:O(n2)
平均时间复杂度:O(nlogn)
*/-/* Quick sort algorithm using sub-rule will be needed to sort the contents read from the file Add the array a [p: r], according to the following three steps to sort a [p] as the base element to the array is divided into three sections , will be greater than the base element on the back of the unit, put in front of a small unit, and then recursively to a [p: q-1], a [q+ 1: r] sort, the last time complexity of the merger degree: the worst time complexity: O (n2) the average time complexity: O (nlogn)* /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
快速排序
........\input.txt
........\output.txt
........\快速排序.cpp
........\input.txt
........\output.txt
........\快速排序.cpp