Time Complexity
best O(n * log n)
Worst O(n^2)
Average O(n * log n)
Space Complexity
O(log n) - because array is divided by pivot and left side of pivot and right side of pivot try to sort again
Opinion
This Sort usually guarantees O(n * log n) but sometimes O(n^2), so it is interesting but I think we have to choose a more efficient Sort.
(I don't put the code or concept because for practice)
https://www.programiz.com/dsa/quick-sort
Top comments (0)