Added sentence on comparisons (#30208)
This commit is contained in:
committed by
Randell Dawson
parent
4b7230001a
commit
0aa4d109d0
@ -17,6 +17,7 @@ But, how would you write the code for finding the index of the second smallest v
|
||||
|
||||
* An easy way is to notice that the smallest value has already been swapped into index 0, so the problem reduces to finding the smallest element in the array starting at index 1.
|
||||
|
||||
Selection sort always takes the same number of key comparisons — N(N − 1)/2.
|
||||
|
||||
### Implementation in C/C++
|
||||
|
||||
|
Reference in New Issue
Block a user