Selection sort's time complexity remains _______ regardless of the input sequence.

  • O(log n)
  • O(n log n)
  • O(n)
  • O(n^2)
The time complexity of selection sort is O(n^2), and it remains the same regardless of the input sequence. This is because it involves nested loops to iterate over the elements for comparisons and swaps, resulting in quadratic time complexity.
Add your answer
Loading...

Leave a comment

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