Quicksort time complexity
The pseudocode of quicksort1:
Let the time taken by quicksort() be where = arr.length.
- Selection of
pivottakes time. partition()takes time ( is a constant).- Let =
less.length. Thenquicksort(less)takes time, andquicksort(greater)takes time. - The total time taken given is (the terms can be elided).