Quicksort Algorithm—An Empirical Study
- 12 Downloads
Quick sort is one of the most sought after algorithms, because if implemented properly quick sort could be much faster than its counterparts, merge sort and heapsort. The main crux of quick sort algorithm is the implementation of the partitioning operation. Nico Lomuto and C. A. R Hoare have put forth partitioning algorithms that have gained prominent significance. Despite this, one can always shed more light on this partially understood operation of partition. Sorting algorithms have been further developed to enhance its performance in terms of computational complexity, memory and other factors. The proposed method is the use of randomized pivot in the implementation of Lomuto partition and Hoare partition algorithms, respectively. It is analysed with and without a randomized pivot element. This paper presents a comparison of the performance of a quick sort algorithm in different cases using contrasting partition approaches with and without randomized pivot. The results provide a theoretical explanation for the observed behaviour and give new insights on behaviour of quick sort algorithm for different cases. The Hoare partition approach with randomized pivot gives best time complexity in comparison to the other cases.
KeywordsQuicksort Analysis of partition algorithms Randomized pivot Best-case complexity
We thank our mentor and guide Dr. Y. L. Malathi Latha, for her constant support and guidance. Her suggestions have been very helpful in the research and compilation for this paper.
- 1.Quicksort-Wikipedia. https://en.wikipedia.org/wiki/Quicksort.
- 2.Hoare, C. A. R. 1962. Quicksort. The Computer Journal 5 (1).Google Scholar
- 3.Sedgewick, Robert. 1978. Implementing Quicksort Algorithms. Communications of the ACM 21 (10).Google Scholar
- 4.Sedgewick, R. 1998. Algorithms in C++, 3rd ed. New York: Addison Wesley.Google Scholar
- 5.Sedgewick, R. 1975. Quicksort. Ph.D. dissertation, Stanford University, Stanford, CA, May 1975. Stanford Computer Science Report STAN-CS-75–492.Google Scholar
- 7.Bentley, J.L., and R. Sedgewick. 1997. Fast Algorithms for Sorting and Searching Strings. In Proceedings of 8th annual ACM-SIAM symposium on Discrete algorithms, New Orleans, Louisiana, USA, 360–369.Google Scholar
- 8.Chaudhuri, R., and Dempster, A.C. 1993. A Note on Slowing Quicksort. SIGCSE 25 (2).Google Scholar
- 10.Jaja, Joseph. 2000. A Perspective on Quicksort, Jan/Feb 2000.Google Scholar
- 11.Knuth, D.E. 1998. The Art of Computer programming, Vol. 3. London: Pearson Education.Google Scholar
- 12.Abhyankar, D., and M. Ingle. 2011. Engineering of a Quicksort Partitioning Algorithm. JGRCS 2 (2).Google Scholar
- 13.Abdullah, Mirza. 2017. Quick Sort with Optimal Worst Case Running Time. AJER 6 (1): 32–36.Google Scholar