Runtime
The runtime of a subarray, which is elements, is
How it works
Partitions a array around a pivot element, where smaller values are to the left, and larger values to the right, and returns the index of the pivot.
Search
Jan 06, 2025, 1 min read
The runtime of a subarray, A[p:r] which is n=r−p+1 elements, is θ(n)
Partitions a array around a pivot element, where smaller values are to the left, and larger values to the right, and returns the index of the pivot.