This commit is contained in:
krahets
2023-03-23 18:56:56 +08:00
parent 2715ce703a
commit 0dfdcf0bab
25 changed files with 118 additions and 115 deletions

View File

@@ -87,7 +87,7 @@ comments: true
=== "Python"
```python title="bubble_sort.py"
def bubble_sort(nums: List[int]) -> None:
def bubble_sort(nums: list[int]) -> None:
""" 冒泡排序 """
n: int = len(nums)
# 外循环:待排序元素数量为 n-1, n-2, ..., 1
@@ -295,7 +295,7 @@ comments: true
=== "Python"
```python title="bubble_sort.py"
def bubble_sort_with_flag(nums: List[int]) -> None:
def bubble_sort_with_flag(nums: list[int]) -> None:
""" 冒泡排序(标志优化) """
n: int = len(nums)
# 外循环:待排序元素数量为 n-1, n-2, ..., 1