摘要
文章在使用前置、后置方法实现快速排序的基础上,对前置、后置操作执行后相邻记录关键字之间是否存在逆位序进行了考查和消除。同时,在高位指针和低位指针移动的过程中,对相邻记录关键字是否存在逆位序也做了类似处理。改进的算法中设计了结构体成员变量part.over用来检测待排序列是否已经非递减有序,从而使得改进后的算法能及时结束递归,避免了无谓的递归划分。
Based on the application of fronting and backing method to make a quick sorting,this paper operates the existence of an inverse order between adjacent records after the execution of the fronting and backing operations has been reviewed and then erased. Meanwhile,similar operations has also been given to inverse order existence of the adjacent records between processes of the fronting of high pointer and the backing of low pointer. Finally,in an improved algorithm proposed in this paper,a struct variable part. over has been designed to detect whether the sequence is non-decreasing and ordinal so that the recursion is ended in time instead of to wait until the interval length is 1.
作者
张晓煜
ZHANG Xiao-yu(School of Information and Engineering,Xizang Minzu University,Xianyang 712082,China)
出处
《渭南师范学院学报》
2018年第16期29-37,共9页
Journal of Weinan Normal University
基金
西藏民族大学科研计划项目:快速排序算法研究(17MDY07)
关键词
前置
后置
快速排序
逆位序
交换
fronting
backing
fast sorting
inverse order
exchange