feat(Go-Tool):新增选择排序及其单测、冒泡排序及其单测、堆排序及其单测

This commit is contained in:
huangzj
2020-08-20 18:05:48 +08:00
parent c2aca17567
commit f4f18b3866
7 changed files with 213 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/*
* @Author : huangzj
* @Time : 2020/8/20 11:21
* @Description:冒泡排序
*/
package sort
func BubbleSort(list []int) {
for i := 0; i < len(list); i++ {
for j := i + 1; j < len(list); j++ {
if list[i] > list[j] {
list[i], list[j] = list[j], list[i]
}
}
}
}