What is the worst-case time complexity of Quick Sort?

  • O(log n)
  • O(n log n)
  • O(n)
  • O(n^2)
The worst-case time complexity of Quick Sort is O(n^2). This occurs when the pivot selection consistently results in unbalanced partitions, leading to a divide-and-conquer strategy with poor performance. The average-case time complexity is O(n log n).
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *