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

  • O(log n)
  • O(n log n)
  • O(n)
  • O(n^2)
The worst-case time complexity of the Quick Sort algorithm is O(n^2). However, on average, it has a time complexity of O(n log n), making it a very efficient sorting algorithm for large datasets. The worst-case scenario occurs when the pivot chosen is always the smallest or largest element, resulting in unbalanced partitions.
Add your answer
Loading...

Leave a comment

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