What is the time complexity of the selection sort algorithm in the worst-case scenario?

  • O(log n)
  • O(n log n)
  • O(n)
  • O(n^2)
The worst-case time complexity of the selection sort algorithm is O(n^2), where 'n' is the number of elements in the array. This is due to the nested loops used to find the minimum element in each iteration.
Add your answer
Loading...

Leave a comment

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