Documentation ¶
Index ¶
- type BTree
- func (tr *BTree) Ascend(pivot interface{}, iter func(item interface{}) bool)
- func (tr *BTree) Delete(key interface{}) interface{}
- func (tr *BTree) DeleteHint(key interface{}, hint *PathHint) interface{}
- func (tr *BTree) Descend(pivot interface{}, iter func(item interface{}) bool)
- func (tr *BTree) Get(key interface{}) interface{}
- func (tr *BTree) GetHint(key interface{}, hint *PathHint) interface{}
- func (tr *BTree) Height() int
- func (tr *BTree) Len() int
- func (tr *BTree) Less(a, b interface{}) bool
- func (tr *BTree) Load(item interface{}) interface{}
- func (tr *BTree) Max() interface{}
- func (tr *BTree) Min() interface{}
- func (tr *BTree) PopMax() interface{}
- func (tr *BTree) PopMin() interface{}
- func (tr *BTree) Set(item interface{}) (prev interface{})
- func (tr *BTree) SetHint(item interface{}, hint *PathHint) (prev interface{})
- func (tr *BTree) Walk(iter func(item []interface{}))
- type PathHint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTree ¶
type BTree struct {
// contains filtered or unexported fields
}
BTree is an ordered set items
func (*BTree) Ascend ¶
Ascend the tree within the range [pivot, last] Pass nil for pivot to scan all item in ascending order Return false to stop iterating
func (*BTree) Delete ¶
func (tr *BTree) Delete(key interface{}) interface{}
Delete a value for a key
func (*BTree) DeleteHint ¶
DeleteHint deletes a value for a key using a path hint
func (*BTree) Descend ¶
Descend the tree within the range [pivot, first] Pass nil for pivot to scan all item in descending order Return false to stop iterating
func (*BTree) Less ¶
Less is a convenience function that performs a comparison of two items using the same "less" function provided to New.
func (*BTree) Load ¶
func (tr *BTree) Load(item interface{}) interface{}
Load is for bulk loading pre-sorted items
func (*BTree) Max ¶
func (tr *BTree) Max() interface{}
Max returns the maximum item in tree. Returns nil if the tree has no items.
func (*BTree) Min ¶
func (tr *BTree) Min() interface{}
Min returns the minimum item in tree. Returns nil if the tree has no items.
func (*BTree) PopMax ¶
func (tr *BTree) PopMax() interface{}
PopMax removes the minimum item in tree and returns it. Returns nil if the tree has no items.
func (*BTree) PopMin ¶
func (tr *BTree) PopMin() interface{}
PopMin removes the minimum item in tree and returns it. Returns nil if the tree has no items.
func (*BTree) Set ¶
func (tr *BTree) Set(item interface{}) (prev interface{})
Set or replace a value for a key