mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-04 22:28:40 +08:00 
			
		
		
		
	Update the chapter sorting (Go code).
This commit is contained in:
		@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-06
 | 
			
		||||
// Author: Slone123c (274325721@qq.com)
 | 
			
		||||
 | 
			
		||||
package bubble_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
/* 冒泡排序 */
 | 
			
		||||
func bubbleSort(nums []int) {
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-06
 | 
			
		||||
// Author: Slone123c (274325721@qq.com)
 | 
			
		||||
 | 
			
		||||
package bubble_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-12
 | 
			
		||||
// Author: msk397 (machangxinq@gmail.com)
 | 
			
		||||
 | 
			
		||||
package insertion_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
func insertionSort(nums []int) {
 | 
			
		||||
	// 外循环:待排序元素数量为 n-1, n-2, ..., 1
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-12
 | 
			
		||||
// Author: msk397 (machangxinq@gmail.com)
 | 
			
		||||
 | 
			
		||||
package insertion_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-13
 | 
			
		||||
// Author: msk397 (machangxinq@gmail.com)
 | 
			
		||||
 | 
			
		||||
package merge_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
// 合并左子数组和右子数组
 | 
			
		||||
// 左子数组区间 [left, mid]
 | 
			
		||||
@ -1,8 +1,9 @@
 | 
			
		||||
package merge_sort
 | 
			
		||||
// File: merge_sort_test.go
 | 
			
		||||
// Created Time: 2022-12-13
 | 
			
		||||
// Author: msk397 (machangxinq@gmail.com)
 | 
			
		||||
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"testing"
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-12
 | 
			
		||||
// Author: msk397 (machangxinq@gmail.com)
 | 
			
		||||
 | 
			
		||||
package quick_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
// 快速排序
 | 
			
		||||
type QuickSort struct{}
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
// Created Time: 2022-12-12
 | 
			
		||||
// Author: msk397 (machangxinq@gmail.com)
 | 
			
		||||
 | 
			
		||||
package quick_sort
 | 
			
		||||
package chapter_sorting
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
		Reference in New Issue
	
	Block a user