A Detailed Analysis of Quicksort Running Time

by Shalosh B. Ekhad and Doron Zeilberger


.pdf   .ps   .tex

First Written: March 8, 2019


One of the greatest algorithms of all time is Quicksort, (it is ranked 7th in this top 10 list). Its average running time is famously O(n log(n)), and its variance, less famously, is O(n2) (hence its standard deviation is O(n)). But what about higher moments? Here we find explicit expressions for the first eight moments, their scaled limits, and we describe how to compute, approximately (but very accurately), percentiles of running time for any list-length.


Added March 12, 2019: Helmut Prodinger pointed our attention to this human-generated gem.

Added March 22, 2019: Sumit Kumar Jha pointed our attention to yet another human-generated gem.


Maple package


Sample Input and Output for QuickSortAnalsis.txt


Pictures


Articles of Doron Zeilberger

Doron Zeilberger's Home Page