On the pivot strategy of Quicksort

J. Munro, X. Ji
{"title":"On the pivot strategy of Quicksort","authors":"J. Munro, X. Ji","doi":"10.1109/CCECE.1996.548097","DOIUrl":null,"url":null,"abstract":"Quicksort is probably the most widely used sorting method in computer science. Although it is well known that its worst-case running time is /spl Theta/(N/sup 2/), it is not clear that what kind of data will cause such slow behavior. In this paper, we prove that a sorted array followed by one or more small elements will do. We also give examples for the pivot method of the middle element, since this is another popular pivot technique in practice. Our examples are pessimistic in the sense that they reach the worst case of Quicksort and cost the maximum number of comparisons for Quicksort, that they are extremely simple for they differ from sorted arrays only by one or two elements, and that they are well constructed so that one may tell their running time even at the first glance. Furthermore, we consider a general non-random pivoting scheme that is based on a constant number of messages about the array elements. We provide a general guideline to construct examples of running time /spl Theta/(N/sup 2/) to this general pivoting scheme.","PeriodicalId":269440,"journal":{"name":"Proceedings of 1996 Canadian Conference on Electrical and Computer Engineering","volume":"32 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1996-05-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of 1996 Canadian Conference on Electrical and Computer Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/CCECE.1996.548097","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

Quicksort is probably the most widely used sorting method in computer science. Although it is well known that its worst-case running time is /spl Theta/(N/sup 2/), it is not clear that what kind of data will cause such slow behavior. In this paper, we prove that a sorted array followed by one or more small elements will do. We also give examples for the pivot method of the middle element, since this is another popular pivot technique in practice. Our examples are pessimistic in the sense that they reach the worst case of Quicksort and cost the maximum number of comparisons for Quicksort, that they are extremely simple for they differ from sorted arrays only by one or two elements, and that they are well constructed so that one may tell their running time even at the first glance. Furthermore, we consider a general non-random pivoting scheme that is based on a constant number of messages about the array elements. We provide a general guideline to construct examples of running time /spl Theta/(N/sup 2/) to this general pivoting scheme.
关于快速排序的支点策略
快速排序可能是计算机科学中使用最广泛的排序方法。虽然众所周知,它的最坏运行时间是/spl Theta/(N/sup 2/),但不清楚什么样的数据会导致如此缓慢的行为。在本文中,我们证明了由一个或多个小元素组成的排序数组可以满足这一要求。我们还给出了中间元素的主元法的例子,因为这是另一种在实践中流行的主元技术。我们的例子是悲观的,因为它们达到了快速排序的最坏情况,并且花费了快速排序的最大次数的比较,它们非常简单,因为它们与排序数组只相差一两个元素,并且它们构造良好,因此甚至第一眼就可以知道它们的运行时间。此外,我们考虑了一种基于关于数组元素的常量消息的一般非随机枢轴方案。我们提供了一个通用的指导方针来构建运行时间/spl Theta/(N/sup 2/)的示例。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信