diff --git a/sorts/selection_sort.py b/sorts/selection_sort.py index 432d14090..c1d66c5a8 100644 --- a/sorts/selection_sort.py +++ b/sorts/selection_sort.py @@ -31,7 +31,7 @@ def selection_sort(collection): """ length = len(collection) - for i in range(length): + for i in range(length - 1): least = i for k in range(i + 1, length): if collection[k] < collection[least]: