// selection sort on n elementsWhat is the time complexity?
- A
O(log n)
- B
O(n)
- C
O(n log n)
- Dcheck_circle
O(n^2)
Explanation
Selection sort always makes ~n^2/2 comparisons regardless of input.
AP Computer Science A· difficulty 2/5
// selection sort on n elementsWhat is the time complexity?
O(log n)
O(n)
O(n log n)
O(n^2)
Explanation
Selection sort always makes ~n^2/2 comparisons regardless of input.
Want 10 more like this — adaptive to your weak spots?