Merge branch 'master' of github.com:Cathay-Chen/hello-algo into Cathay-Chen-master

This commit is contained in:
Yudong Jin
2022-12-13 23:27:48 +08:00
5 changed files with 235 additions and 1 deletions

View File

@ -908,7 +908,7 @@ $$
```go title="time_complexity_types.go"
/* 平方阶(冒泡排序) */
func bubbleSort(nums []int) int {
count := 0 // 计数器
count := 0 // 计数器
// 外循环:待排序元素数量为 n-1, n-2, ..., 1
for i := len(nums) - 1; i > 0; i-- {
// 内循环:冒泡操作