-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
56 lines (52 loc) · 945 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import (
"alg/common"
"fmt"
)
func main() {
bloom := common.NewDefaultBloomFilter()
bloom.Add("1")
bloom.Add("2")
bloom.Add("3")
bloom.Add("4")
fmt.Println(bloom.Has("1"))
fmt.Println(bloom.Has("6"))
//bm := common.NewBitMap(0x01 << 44)
//_ = bm
//bm.SetBit(55, 1)
//fmt.Println(bm.GetBit(55))
//s := common.NewSnowFlake(3)
//to := time.After(time.Second)
//wg1 := sync.WaitGroup{}
//wg1.Add(1)
//go func() {
// for {
// select {
// case <-to:
// wg1.Done()
// break
// default:
// id := s.GetID()
// fmt.Println(id)
// }
// }
//}()
//
//wg1.Wait()
//return
//sample.Reservoir()
//ll := others.NewLinkList()
//fmt.Println("链表大小", ll.Size())
//node := &others.Node{
// Value: "haha",
//}
//ll.Append(node)
//ll.Print()
//node2 := &others.Node{
// Value: map[int]string{1: "one", 2: "two"},
//}
//ll.InsertBefore(node2, node)
//ll.Print()
//
//ll.Remove(node2)
}