Quick Sort is a divide-and-conquer sorting algorithm that picks a "pivot" element, partitions the array around the pivot so that elements less than the pivot are on the left and elements greater are on the right, and then recursively sorts the sub-arrays. It has an average time complexity of
𝑂
(
𝑛
log
𝑛
)
O(nlogn) but can degrade to
𝑂
(
𝑛
2
)
O(n
2
) in the worst case if the pivot choices are unbalanced.
Quick Sort is a divide-and-conquer sorting algorithm that picks a "pivot" element, partitions the array around the pivot so that elements less than the pivot are on the left and elements greater are on the right, and then recursively sorts the sub-arrays. It has an average time complexity of 𝑂 ( 𝑛 log 𝑛 ) O(nlogn) but can degrade to 𝑂 ( 𝑛 2 ) O(n 2 ) in the worst case if the pivot choices are unbalanced.
36