Which sorting algorithm exhibits quadratic time complexity in the worst-case scenario?

  • Bubble Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
Bubble sort exhibits quadratic time complexity in the worst-case scenario. This happens when the array is in reverse order or nearly sorted, causing the algorithm to make a large number of comparisons and swaps for each element, leading to a time complexity of O(n^2).
Add your answer
Loading...

Leave a comment

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