mirror of
https://github.com/krahets/hello-algo.git
synced 2025-02-02 22:43:50 +08:00
Merge branch 'Cathay-Chen-master'
This commit is contained in:
commit
31f062d3d5
@ -908,7 +908,7 @@ $$
|
||||
```go title="time_complexity.go"
|
||||
/* 平方阶(冒泡排序) */
|
||||
func bubbleSort(nums []int) int {
|
||||
count := 0 // 计数器
|
||||
count := 0 // 计数器
|
||||
// 外循环:待排序元素数量为 n-1, n-2, ..., 1
|
||||
for i := len(nums) - 1; i > 0; i-- {
|
||||
// 内循环:冒泡操作
|
||||
|
Loading…
Reference in New Issue
Block a user