Documentation ¶
Index ¶
- type BTree
- func (b *BTree) AscendGt(k Node, filter FilterFn, n int) []Node
- func (b *BTree) AscendGte(k Node, filter FilterFn, n int) []Node
- func (b *BTree) Delete(k Node) bool
- func (b *BTree) DescendLt(k Node, filter FilterFn, n int) []Node
- func (b *BTree) DescendLte(k Node, filter FilterFn, n int) []Node
- func (b *BTree) Get(k Node) Node
- func (b *BTree) Insert(v Node)
- func (b *BTree) Update(oldV Node, newV Node) bool
- func (b *BTree) UpdateOrInsert(oldV Node, newV Node) bool
- type FilterFn
- type Node
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 : wrapped b-tree
func (*BTree) AscendGt ¶
AscendGt : ascend get nodes(>k). k : anchor key filter : filter a node n : the max length of nodes to get
func (*BTree) AscendGte ¶
AscendGte : ascend get nodes(>=k). k : anchor key filter : filter a node n : the max length of nodes to get
func (*BTree) Delete ¶
Delete : delete node, actually, figure out a node which related node sort fields match. Return : bool If deleted node exist, return true, else return false
func (*BTree) DescendLt ¶
DescendLt : descend get nodes(<k). k : anchor key filter : filter a node n : the max length of nodes to get
func (*BTree) DescendLte ¶
DescendLte : descend get nodes(<=k). k : anchor key filter : filter a node n : the max length of nodes to get
func (*BTree) Update ¶
Update : update old node to given new node. If old node not exist, the newV could not be updated. Return : if old node not exist, return false, else return true.
func (*BTree) UpdateOrInsert ¶
UpdateOrInsert : if ole node exists, update old node to new node, else insert new node to btree. The new node will always be inserted or replaced. Return : bool If ole node not exist, return false, it indicates that ole node not found but new node be inserted. Else return ture.