This commit is contained in:
krahets
2023-03-03 02:46:12 +08:00
parent 122805bdc9
commit cf9d102ed5
24 changed files with 320 additions and 314 deletions
+2 -2
View File
@@ -63,9 +63,9 @@ comments: true
=== "Python"
```python title="insertion_sort.py"
""" 插入排序 """
def insertion_sort(nums):
# 外循环:base = nums[1], nums[2], ..., nums[n-1]
""" 插入排序 """
# 外循环:base = nums[1], nums[2], ..., nums[n-1]
for i in range(1, len(nums)):
base = nums[i]
j = i - 1