Time Complexity
best O(n^2)
Worst O(n^2)
Average O(n^2)
Space Complexity
O(1) - because only use one temp variable
BigOh
O(n^2)
Opinion
This algorithm has very strict occur but has the worst time Complexity So when you use this algorithm for a huge structure it is hard to use this algorithm.
(I don't put the code or concept because for practice)
https://www.programiz.com/dsa/selection-sort
Top comments (0)