feat(Go-Tool):新增二分法查找算法及其单测、插入查询及其单测、lomuto划分查询第k小元素及其单测、归并排序及其单测、快速排序及其单测.

This commit is contained in:
huangzj
2020-08-20 09:28:35 +08:00
parent fa58e1a97f
commit c2aca17567
12 changed files with 385 additions and 8 deletions
+2 -2
View File
@@ -13,13 +13,13 @@ import (
func TestPartition(t *testing.T) {
list := []int{99, 1, 2, 3, 4, 100, 200, 90, 5}
s := partition(list, 0, 9-1)
s := LomutoPartition(list, 0, 9-1)
fmt.Println(fmt.Sprintf("当前第一个元素应该存在位置为:%d", s))
for _, r := range list {
fmt.Print(r, " ")
}
s = partition(list, 0, 9-1)
s = LomutoPartition(list, 0, 9-1)
fmt.Println(fmt.Sprintf("当前第一个元素应该存在位置为:%d", s))
for _, r := range list {
fmt.Print(r, " ")