Complexity of quick sort

 

The worst case complexity of quick sort can be similar to bubble sort's complexity. The selection of the pivot actually causes this. Here is the complexity chart for a quick sort:

Best time complexity

Ω(nlog(n))

Worst time complexity

O(n2)

Average time complexity

Θ(nlog(n))

Space complexity (worst case)

O(log(n))

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset