From 0aa4d109d047e65928fb65529680e80b7b205a99 Mon Sep 17 00:00:00 2001 From: kellyhuang21 Date: Wed, 13 Feb 2019 19:36:54 -0800 Subject: [PATCH] Added sentence on comparisons (#30208) --- .../algorithms/sorting-algorithms/selection-sort/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/guide/english/algorithms/sorting-algorithms/selection-sort/index.md b/guide/english/algorithms/sorting-algorithms/selection-sort/index.md index e08e8bafd1..42f1bd4106 100644 --- a/guide/english/algorithms/sorting-algorithms/selection-sort/index.md +++ b/guide/english/algorithms/sorting-algorithms/selection-sort/index.md @@ -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++