mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
Updated vednor files
This commit is contained in:
26
vendor/github.com/petar/GoLLRB/example/ex1.go
generated
vendored
26
vendor/github.com/petar/GoLLRB/example/ex1.go
generated
vendored
@ -1,26 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/petar/GoLLRB/llrb"
|
||||
)
|
||||
|
||||
func lessInt(a, b interface{}) bool { return a.(int) < b.(int) }
|
||||
|
||||
func main() {
|
||||
tree := llrb.New(lessInt)
|
||||
tree.ReplaceOrInsert(1)
|
||||
tree.ReplaceOrInsert(2)
|
||||
tree.ReplaceOrInsert(3)
|
||||
tree.ReplaceOrInsert(4)
|
||||
tree.DeleteMin()
|
||||
tree.Delete(4)
|
||||
c := tree.IterAscend()
|
||||
for {
|
||||
u := <-c
|
||||
if u == nil {
|
||||
break
|
||||
}
|
||||
fmt.Printf("%d\n", int(u.(int)))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user