The partitioning routine in Quicksort always produces a 99-to-1 split of the input array. The running time of Quicksort in this case would be ______ code example
Example: analysis of quick sort
T(n) = 2*T(n/2) + n
= 2*[ 2*T(n/4) + n/2 ] + n
= 22*T(n/4) + n + n
= 22*T(n/4) + 2n
= 22*[ 2*T(n/8) + (n/4) ] + 2n
= 23*T(n/8) + 22*(n/4) + 2n
= 23*T(n/8) + n + 2n
= 23*T(n/8) + 3n
= 24*T(n/16) + 4n
and so on....
= 2k*T(n/(2k)) + k*n
= 2k*T(1) + k*n
= 2k*1 + k*n
= 2k + k*n
= n + k*n
= n + (lg(n))*n
= n*( lg(n) + 1 )
~= n*lg(n))