Skip to content

Commit 0c51b9a

Browse files
committed
Merge branch 'master' of github.com:PegasusWang/python_data_structures_and_algorithms
2 parents d578958 + feb9991 commit 0c51b9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/12_基本排序算法/basic_sort.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
# 冒泡排序
6-
bubble sort 可以说是最简单的一种排序算法了,它的思想如下。对一个数组进行 n 轮迭代,每次比较相邻两个元素,
6+
bubble sort 可以说是最简单的一种排序算法了,它的思想如下。对一个数组进行 n-1 轮迭代,每次比较相邻两个元素,
77
如果相邻的元素前者大于后者,就交换它们。因为直接在元素上操作而不是返回新的数组,所以是一个 inplace 的操作。
88
这里冒泡的意思其实就是每一轮冒泡一个最大的元素就会通过不断比较和交换相邻元素使它转移到最右边。
99

0 commit comments

Comments
 (0)