We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4efdf73 commit 993df1aCopy full SHA for 993df1a
sorts/insertion_sort/insertion_sort.py
@@ -23,7 +23,7 @@ def insertion_sort(unsorted_collection):
23
while index > 0 and unsorted_collection[index - 1] > unsorted_collection[index]: # 前一个元素大于后一个元素
24
unsorted_collection[index], unsorted_collection[index - 1] = unsorted_collection[index - 1], \
25
unsorted_collection[index]
26
- index -= 1 # 只保持前面已经排列的有序,这点和冒泡相反,冒泡每次排序都保证末端有序
+ index -= 1 # 只保持前面已经排列的有序,这点和冒泡相反,冒泡每次排序都保证末端有序
27
return unsorted_collection
28
29
0 commit comments