Runtime anaylsis of the Quick Sort algorithm

  • Running time of the Quick Sort algorithm:

    • The running time of Quick Sort depends on how partition( ) splits up the input array

  • Recall the partition(A, s, e) algorithm:

      Input:     [ 5   1   7   2   8   9   3   6 ]
    
      Result:    [ 1   2   3   5   7   8   9   6 ]
                   <------->       <------------>
                      < 5             >= 5
    

  • Important fact:

    • The running time of Quick Sort depends on how large the 2 array halves are !