Loading...
Loading...
0
ops.
0
ops.
0
ops.
0
ops.
0
comp.
0
ms
0
sec
0
ops/ms
0
comp/ms
[1] Sum of Swap, Get, Set and Comparison operations.
[2] Swap operations do not count as neither Get nor Set operations.
Quick sort is a comparison sort that is efficient on average. It is a divide and conquer algorithm that works by selecting a pivot element from the array and partitioning the other elements into two sub-arrays according to whether they are less than or greater than the pivot. The sub-arrays are then sorted recursively. This can be done in-place, requiring small additional amounts of memory to perform the sorting.
Read moreThere are many different versions of quicksort that pick pivot in different ways. The choice of pivot can make a big difference in the performance of quicksort.
Big O Notation | |||
---|---|---|---|
Time complexity | Space complexity | ||
Worst | Average | Best | Worst |
O(n^2) | Θ(nlog n) | Ω(nlog n) | O(log n) |
Big O Notation defines the lower, average and upper bounds of an algorithm, where Time complexity determines the amount of operations, and Space complexity the amount of memory that can be used
This site uses cookies to ensure you the best experiences of all.
By continuing, I must assume you're okay with them, however, you can read more about them here.
Continue