Quicksort Algorithm—An Empirical Study

  • Gampa Rahul
  • Polamuri Sandeep
  • Y. L. Malathi LathaEmail author
Conference paper
Part of the Advances in Intelligent Systems and Computing book series (AISC, volume 1090)


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.


Quicksort 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. 1.
  2. 2.
    Hoare, C. A. R. 1962. Quicksort. The Computer Journal 5 (1).Google Scholar
  3. 3.
    Sedgewick, Robert. 1978. Implementing Quicksort Algorithms. Communications of the ACM 21 (10).Google Scholar
  4. 4.
    Sedgewick, R. 1998. Algorithms in C++, 3rd ed. New York: Addison Wesley.Google Scholar
  5. 5.
    Sedgewick, R. 1975. Quicksort. Ph.D. dissertation, Stanford University, Stanford, CA, May 1975. Stanford Computer Science Report STAN-CS-75–492.Google Scholar
  6. 6.
    Loeser, R. 1974. Some performance tests of:quicksort: and descendants. Communications of ACM 17 (3): 143–152.CrossRefGoogle Scholar
  7. 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. 8.
    Chaudhuri, R., and Dempster, A.C. 1993. A Note on Slowing Quicksort. SIGCSE 25 (2).Google Scholar
  9. 9.
    Sedgewick, R. 1977. The Analysis of Quicksort Programs. Acta Informatica 7: 327–355.MathSciNetCrossRefGoogle Scholar
  10. 10.
    Jaja, Joseph. 2000. A Perspective on Quicksort, Jan/Feb 2000.Google Scholar
  11. 11.
    Knuth, D.E. 1998. The Art of Computer programming, Vol. 3. London: Pearson Education.Google Scholar
  12. 12.
    Abhyankar, D., and M. Ingle. 2011. Engineering of a Quicksort Partitioning Algorithm. JGRCS 2 (2).Google Scholar
  13. 13.
    Abdullah, Mirza. 2017. Quick Sort with Optimal Worst Case Running Time. AJER 6 (1): 32–36.Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2020

Authors and Affiliations

  • Gampa Rahul
    • 1
  • Polamuri Sandeep
    • 1
  • Y. L. Malathi Latha
    • 1
    Email author
  1. 1.CSE DepartmentSwami Vivekananda Institute of Technology (SVIT)HyderabadIndia

Personalised recommendations