mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-12 07:26:07 +00:00
build
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user