Multiple choice

What is the worst case space complexity of selection sort?

  1. O(n2)

  2. O(n)

  3. O(nlog n)

  4. O(n^2log n)

  5. O(log n)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Selection sort is a sorting algorithm, specifically an in-place comparison sort. It has space complexity of O(n) in the worst case.