tree

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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 NewBTree

func NewBTree() *BTree

NewBTree : new

func (*BTree) AscendGt

func (b *BTree) AscendGt(k Node, filter FilterFn, n int) []Node

AscendGt : ascend get nodes(>k). k : anchor key filter : filter a node n : the max length of nodes to get

func (*BTree) AscendGte

func (b *BTree) AscendGte(k Node, filter FilterFn, n int) []Node

AscendGte : ascend get nodes(>=k). k : anchor key filter : filter a node n : the max length of nodes to get

func (*BTree) Delete

func (b *BTree) Delete(k Node)

Delete : delete node, actually, figure out a node which related node sort fields match.

func (*BTree) DescendLt

func (b *BTree) DescendLt(k Node, filter FilterFn, n int) []Node

DescendLt : descend get nodes(<k). k : anchor key filter : filter a node n : the max length of nodes to get

func (*BTree) DescendLte

func (b *BTree) DescendLte(k Node, filter FilterFn, n int) []Node

DescendLte : descend get nodes(<=k). k : anchor key filter : filter a node n : the max length of nodes to get

func (*BTree) Get

func (b *BTree) Get(k Node) Node

func (*BTree) Insert

func (b *BTree) Insert(v Node)

Insert : insert node to btree

func (*BTree) Update

func (b *BTree) Update(oldV Node, newV Node)

Update : update old node to given new node.

func (*BTree) UpdateOrInsert

func (b *BTree) UpdateOrInsert(oldV Node, newV Node)

UpdateOrInsert : if ole node exists, update old node to new node, else insert new node to btree.

type FilterFn

type FilterFn func(n Node) bool

FilterFn : filter a node value is in condition or not

type Node added in v0.0.9

type Node = btree.Item

Node : redirect btree.Item

Directories

Path Synopsis
Package btree implements in-memory B-Trees of arbitrary degree.
Package btree implements in-memory B-Trees of arbitrary degree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL