feat(Go-Tool):修改单测位置,添加lomuto查找第k小元素算法代码及其单测(分治法)

This commit is contained in:
huangzj
2020-08-18 17:29:42 +08:00
parent 3f0e3b27f7
commit fa58e1a97f
27 changed files with 322 additions and 251 deletions
+24
View File
@@ -0,0 +1,24 @@
/*
* @Author : huangzj
* @Time : 2020/6/29 17:15
* @Description
*/
package rand
import (
"fmt"
"strconv"
"testing"
)
func TestRand(t *testing.T) {
fmt.Printf(strconv.Itoa(GetRandInt(100, 2000)))
for _, r := range GetRandIntNoRepeat(10, 100, 200) {
fmt.Printf(strconv.Itoa(r))
}
for _, r := range GetDiffNum([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 10) {
fmt.Printf(strconv.Itoa(r))
}
}