feat(Go-Tool):修改单测位置,添加lomuto查找第k小元素算法代码及其单测(分治法)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* @Author : huangzj
|
||||
* @Time : 2020/6/15 17:17
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package set
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSet(t *testing.T) {
|
||||
set := new(Set)
|
||||
set.Add(1)
|
||||
set.Add(2)
|
||||
set.Add("123")
|
||||
fmt.Println(set.Contains(3))
|
||||
fmt.Println(set.Contains("456"))
|
||||
fmt.Println(set.Contains("123"))
|
||||
fmt.Println(set.Contains(1))
|
||||
|
||||
set.Remove(1)
|
||||
set.Remove(3)
|
||||
for _, v := range set.GetAllSet() {
|
||||
fmt.Println(v)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user