Average - θ(n log(n))
Worst - O(n log(n))
Recursively divides an array into smaller subarrays, sorting each subarray, then merging the sorted subarrays together.
Here is an in-depthexplanation
Average - θ(n log(n))
Worst - O(n^2)
Recursively partitions the array, moving elements smaller than the pivot, to the left of the pivot and elements larger to the right.
Here is an in-depthexplanation
Average - θ(n^2)
Worst - O(n^2)
Loops through array for each element, comparing adjacent elements, moving the larger element to the right.
Here is an in-depthexplanation
Average - θ(n^2)
Worst - O(n^2)
Loops through array for each element, keeping track of the last minimum value seen, and moving it to the start of the loop.
Here is an in-depthexplanation