{"title":"关于快速排序的支点策略","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":"{\"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}","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}
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.