gf: github.com/gogf/gf/g/container/gtree Index | Files

package gtree

import "github.com/gogf/gf/g/container/gtree"

Package gtree provides concurrent-safe/unsafe tree containers.

Index

Package Files

gtree.go gtree_avltree.go gtree_btree.go gtree_redblacktree.go

type AVLTree Uses

type AVLTree struct {
    // contains filtered or unexported fields
}

AVLTree holds elements of the AVL tree.

func NewAVLTree Uses

func NewAVLTree(comparator func(v1, v2 interface{}) int, unsafe ...bool) *AVLTree

NewAVLTree instantiates an AVL tree with the custom key comparator. The parameter <unsafe> used to specify whether using tree in un-concurrent-safety, which is false in default.

func NewAVLTreeFrom Uses

func NewAVLTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, unsafe ...bool) *AVLTree

NewAVLTreeFrom instantiates an AVL tree with the custom key comparator and data map. The parameter <unsafe> used to specify whether using tree in un-concurrent-safety, which is false in default.

func (*AVLTree) Ceiling Uses

func (tree *AVLTree) Ceiling(key interface{}) (ceiling *AVLTreeNode, found bool)

Ceiling finds ceiling node of the input key, return the ceiling node or nil if no ceiling node is found. Second return parameter is true if ceiling was found, otherwise false.

Ceiling node is defined as the smallest node that is larger than or equal to the given node. A ceiling node may not be found, either because the tree is empty, or because all nodes in the tree is smaller than the given node.

Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AVLTree) Clear Uses

func (tree *AVLTree) Clear()

Clear removes all nodes from the tree.

func (*AVLTree) Clone Uses

func (tree *AVLTree) Clone(unsafe ...bool) *AVLTree

Clone returns a new tree with a copy of current tree.

func (*AVLTree) Contains Uses

func (tree *AVLTree) Contains(key interface{}) bool

Contains checks whether <key> exists in the tree.

func (*AVLTree) Flip Uses

func (tree *AVLTree) Flip(comparator ...func(v1, v2 interface{}) int)

Flip exchanges key-value of the tree to value-key. Note that you should guarantee the value is the same type as key, or else the comparator would panic.

If the type of value is different with key, you pass the new <comparator>.

func (*AVLTree) Floor Uses

func (tree *AVLTree) Floor(key interface{}) (floor *AVLTreeNode, found bool)

Floor Finds floor node of the input key, return the floor node or nil if no floor node is found. Second return parameter is true if floor was found, otherwise false.

Floor node is defined as the largest node that is smaller than or equal to the given node. A floor node may not be found, either because the tree is empty, or because all nodes in the tree is larger than the given node.

Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AVLTree) Get Uses

func (tree *AVLTree) Get(key interface{}) (value interface{})

Get searches the node in the tree by <key> and returns its value or nil if key is not found in tree.

func (*AVLTree) GetOrSet Uses

func (tree *AVLTree) GetOrSet(key interface{}, value interface{}) interface{}

GetOrSet returns the value by key, or set value with given <value> if not exist and returns this value.

func (*AVLTree) GetOrSetFunc Uses

func (tree *AVLTree) GetOrSetFunc(key interface{}, f func() interface{}) interface{}

GetOrSetFunc returns the value by key, or sets value with return value of callback function <f> if not exist and returns this value.

func (*AVLTree) GetOrSetFuncLock Uses

func (tree *AVLTree) GetOrSetFuncLock(key interface{}, f func() interface{}) interface{}

GetOrSetFuncLock returns the value by key, or sets value with return value of callback function <f> if not exist and returns this value.

GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function <f> with mutex.Lock of the hash map.

func (*AVLTree) GetVar Uses

func (tree *AVLTree) GetVar(key interface{}) *gvar.Var

GetVar returns a gvar.Var with the value by given <key>. The returned gvar.Var is un-concurrent safe.

func (*AVLTree) GetVarOrSet Uses

func (tree *AVLTree) GetVarOrSet(key interface{}, value interface{}) *gvar.Var

GetVarOrSet returns a gvar.Var with result from GetVarOrSet. The returned gvar.Var is un-concurrent safe.

func (*AVLTree) GetVarOrSetFunc Uses

func (tree *AVLTree) GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var

GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc. The returned gvar.Var is un-concurrent safe.

func (*AVLTree) GetVarOrSetFuncLock Uses

func (tree *AVLTree) GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var

GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock. The returned gvar.Var is un-concurrent safe.

func (*AVLTree) IsEmpty Uses

func (tree *AVLTree) IsEmpty() bool

IsEmpty returns true if tree does not contain any nodes.

func (*AVLTree) Iterator Uses

func (tree *AVLTree) Iterator(f func(key, value interface{}) bool)

Iterator is alias of IteratorAsc.

func (*AVLTree) IteratorAsc Uses

func (tree *AVLTree) IteratorAsc(f func(key, value interface{}) bool)

IteratorAsc iterates the tree in ascending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.

func (*AVLTree) IteratorDesc Uses

func (tree *AVLTree) IteratorDesc(f func(key, value interface{}) bool)

IteratorDesc iterates the tree in descending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.

func (*AVLTree) Keys Uses

func (tree *AVLTree) Keys() []interface{}

Keys returns all keys in asc order.

func (*AVLTree) Left Uses

func (tree *AVLTree) Left() *AVLTreeNode

Left returns the minimum element of the AVL tree or nil if the tree is empty.

func (*AVLTree) Map Uses

func (tree *AVLTree) Map() map[interface{}]interface{}

Map returns all key-value items as map.

func (*AVLTree) MarshalJSON Uses

func (tree *AVLTree) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*AVLTree) Print Uses

func (tree *AVLTree) Print()

Print prints the tree to stdout.

func (*AVLTree) Remove Uses

func (tree *AVLTree) Remove(key interface{}) (value interface{})

Remove removes the node from the tree by key. Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AVLTree) Removes Uses

func (tree *AVLTree) Removes(keys []interface{})

Removes batch deletes values of the tree by <keys>.

func (*AVLTree) Right Uses

func (tree *AVLTree) Right() *AVLTreeNode

Right returns the maximum element of the AVL tree or nil if the tree is empty.

func (*AVLTree) Search Uses

func (tree *AVLTree) Search(key interface{}) (value interface{}, found bool)

Search searches the tree with given <key>. Second return parameter <found> is true if key was found, otherwise false.

func (*AVLTree) Set Uses

func (tree *AVLTree) Set(key interface{}, value interface{})

Set inserts node into the tree.

func (*AVLTree) SetIfNotExist Uses

func (tree *AVLTree) SetIfNotExist(key interface{}, value interface{}) bool

SetIfNotExist sets <value> to the map if the <key> does not exist, then return true. It returns false if <key> exists, and <value> would be ignored.

func (*AVLTree) SetIfNotExistFunc Uses

func (tree *AVLTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool

SetIfNotExistFunc sets value with return value of callback function <f>, then return true. It returns false if <key> exists, and <value> would be ignored.

func (*AVLTree) SetIfNotExistFuncLock Uses

func (tree *AVLTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool

SetIfNotExistFuncLock sets value with return value of callback function <f>, then return true. It returns false if <key> exists, and <value> would be ignored.

SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that it executes function <f> with mutex.Lock of the hash map.

func (*AVLTree) Sets Uses

func (tree *AVLTree) Sets(data map[interface{}]interface{})

Sets batch sets key-values to the tree.

func (*AVLTree) Size Uses

func (tree *AVLTree) Size() int

Size returns number of nodes in the tree.

func (*AVLTree) String Uses

func (tree *AVLTree) String() string

String returns a string representation of container

func (*AVLTree) Values Uses

func (tree *AVLTree) Values() []interface{}

Values returns all values in asc order based on the key.

type AVLTreeNode Uses

type AVLTreeNode struct {
    Key   interface{}
    Value interface{}
    // contains filtered or unexported fields
}

AVLTreeNode is a single element within the tree.

func (*AVLTreeNode) Next Uses

func (node *AVLTreeNode) Next() *AVLTreeNode

Next returns the next element in an inorder walk of the AVL tree.

func (*AVLTreeNode) Prev Uses

func (node *AVLTreeNode) Prev() *AVLTreeNode

Prev returns the previous element in an inorder walk of the AVL tree.

type BTree Uses

type BTree struct {
    // contains filtered or unexported fields
}

BTree holds elements of the B-tree.

func NewBTree Uses

func NewBTree(m int, comparator func(v1, v2 interface{}) int, unsafe ...bool) *BTree

NewBTree instantiates a B-tree with <m> (maximum number of children) and a custom key comparator. The parameter <unsafe> used to specify whether using tree in un-concurrent-safety, which is false in default. Note that the <m> must be greater or equal than 3, or else it panics.

func NewBTreeFrom Uses

func NewBTreeFrom(m int, comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, unsafe ...bool) *BTree

NewBTreeFrom instantiates a B-tree with <m> (maximum number of children), a custom key comparator and data map. The parameter <unsafe> used to specify whether using tree in un-concurrent-safety, which is false in default.

func (*BTree) Clear Uses

func (tree *BTree) Clear()

Clear removes all nodes from the tree.

func (*BTree) Clone Uses

func (tree *BTree) Clone(unsafe ...bool) *BTree

Clone returns a new tree with a copy of current tree.

func (*BTree) Contains Uses

func (tree *BTree) Contains(key interface{}) bool

Contains checks whether <key> exists in the tree.

func (*BTree) Get Uses

func (tree *BTree) Get(key interface{}) (value interface{})

Get searches the node in the tree by <key> and returns its value or nil if key is not found in tree.

func (*BTree) GetOrSet Uses

func (tree *BTree) GetOrSet(key interface{}, value interface{}) interface{}

GetOrSet returns the value by key, or set value with given <value> if not exist and returns this value.

func (*BTree) GetOrSetFunc Uses

func (tree *BTree) GetOrSetFunc(key interface{}, f func() interface{}) interface{}

GetOrSetFunc returns the value by key, or sets value with return value of callback function <f> if not exist and returns this value.

func (*BTree) GetOrSetFuncLock Uses

func (tree *BTree) GetOrSetFuncLock(key interface{}, f func() interface{}) interface{}

GetOrSetFuncLock returns the value by key, or sets value with return value of callback function <f> if not exist and returns this value.

GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function <f> with mutex.Lock of the hash map.

func (*BTree) GetVar Uses

func (tree *BTree) GetVar(key interface{}) *gvar.Var

GetVar returns a gvar.Var with the value by given <key>. The returned gvar.Var is un-concurrent safe.

func (*BTree) GetVarOrSet Uses

func (tree *BTree) GetVarOrSet(key interface{}, value interface{}) *gvar.Var

GetVarOrSet returns a gvar.Var with result from GetVarOrSet. The returned gvar.Var is un-concurrent safe.

func (*BTree) GetVarOrSetFunc Uses

func (tree *BTree) GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var

GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc. The returned gvar.Var is un-concurrent safe.

func (*BTree) GetVarOrSetFuncLock Uses

func (tree *BTree) GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var

GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock. The returned gvar.Var is un-concurrent safe.

func (*BTree) Height Uses

func (tree *BTree) Height() int

Height returns the height of the tree.

func (*BTree) IsEmpty Uses

func (tree *BTree) IsEmpty() bool

Empty returns true if tree does not contain any nodes

func (*BTree) Iterator Uses

func (tree *BTree) Iterator(f func(key, value interface{}) bool)

Iterator is alias of IteratorAsc.

func (*BTree) IteratorAsc Uses

func (tree *BTree) IteratorAsc(f func(key, value interface{}) bool)

IteratorAsc iterates the tree in ascending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.

func (*BTree) IteratorDesc Uses

func (tree *BTree) IteratorDesc(f func(key, value interface{}) bool)

IteratorDesc iterates the tree in descending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.

func (*BTree) Keys Uses

func (tree *BTree) Keys() []interface{}

Keys returns all keys in asc order.

func (*BTree) Left Uses

func (tree *BTree) Left() *BTreeEntry

Left returns the left-most (min) entry or nil if tree is empty.

func (*BTree) Map Uses

func (tree *BTree) Map() map[interface{}]interface{}

Map returns all key-value items as map.

func (*BTree) MarshalJSON Uses

func (tree *BTree) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*BTree) Print Uses

func (tree *BTree) Print()

Print prints the tree to stdout.

func (*BTree) Remove Uses

func (tree *BTree) Remove(key interface{}) (value interface{})

Remove removes the node from the tree by <key>.

func (*BTree) Removes Uses

func (tree *BTree) Removes(keys []interface{})

Removes batch deletes values of the tree by <keys>.

func (*BTree) Right Uses

func (tree *BTree) Right() *BTreeEntry

Right returns the right-most (max) entry or nil if tree is empty.

func (*BTree) Search Uses

func (tree *BTree) Search(key interface{}) (value interface{}, found bool)

Search searches the tree with given <key>. Second return parameter <found> is true if key was found, otherwise false.

func (*BTree) Set Uses

func (tree *BTree) Set(key interface{}, value interface{})

Set inserts key-value item into the tree.

func (*BTree) SetIfNotExist Uses

func (tree *BTree) SetIfNotExist(key interface{}, value interface{}) bool

SetIfNotExist sets <value> to the map if the <key> does not exist, then return true. It returns false if <key> exists, and <value> would be ignored.

func (*BTree) SetIfNotExistFunc Uses

func (tree *BTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool

SetIfNotExistFunc sets value with return value of callback function <f>, then return true. It returns false if <key> exists, and <value> would be ignored.

func (*BTree) SetIfNotExistFuncLock Uses

func (tree *BTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool

SetIfNotExistFuncLock sets value with return value of callback function <f>, then return true. It returns false if <key> exists, and <value> would be ignored.

SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that it executes function <f> with mutex.Lock of the hash map.

func (*BTree) Sets Uses

func (tree *BTree) Sets(data map[interface{}]interface{})

Sets batch sets key-values to the tree.

func (*BTree) Size Uses

func (tree *BTree) Size() int

Size returns number of nodes in the tree.

func (*BTree) String Uses

func (tree *BTree) String() string

String returns a string representation of container (for debugging purposes)

func (*BTree) Values Uses

func (tree *BTree) Values() []interface{}

Values returns all values in asc order based on the key.

type BTreeEntry Uses

type BTreeEntry struct {
    Key   interface{}
    Value interface{}
}

BTreeEntry represents the key-value pair contained within nodes.

type BTreeNode Uses

type BTreeNode struct {
    Parent   *BTreeNode
    Entries  []*BTreeEntry // Contained keys in node
    Children []*BTreeNode  // Children nodes
}

BTreeNode is a single element within the tree.

type RedBlackTree Uses

type RedBlackTree struct {
    // contains filtered or unexported fields
}

RedBlackTree holds elements of the red-black tree.

func NewRedBlackTree Uses

func NewRedBlackTree(comparator func(v1, v2 interface{}) int, unsafe ...bool) *RedBlackTree

NewRedBlackTree instantiates a red-black tree with the custom key comparator. The parameter <unsafe> used to specify whether using tree in un-concurrent-safety, which is false in default.

func NewRedBlackTreeFrom Uses

func NewRedBlackTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, unsafe ...bool) *RedBlackTree

NewRedBlackTreeFrom instantiates a red-black tree with the custom key comparator and <data> map. The parameter <unsafe> used to specify whether using tree in un-concurrent-safety, which is false in default.

func (*RedBlackTree) Ceiling Uses

func (tree *RedBlackTree) Ceiling(key interface{}) (ceiling *RedBlackTreeNode, found bool)

Ceiling finds ceiling node of the input key, return the ceiling node or nil if no ceiling node is found. Second return parameter is true if ceiling was found, otherwise false.

Ceiling node is defined as the smallest node that its key is larger than or equal to the given <key>. A ceiling node may not be found, either because the tree is empty, or because all nodes in the tree are smaller than the given node.

func (*RedBlackTree) Clear Uses

func (tree *RedBlackTree) Clear()

Clear removes all nodes from the tree.

func (*RedBlackTree) Clone Uses

func (tree *RedBlackTree) Clone(unsafe ...bool) *RedBlackTree

Clone returns a new tree with a copy of current tree.

func (*RedBlackTree) Contains Uses

func (tree *RedBlackTree) Contains(key interface{}) bool

Contains checks whether <key> exists in the tree.

func (*RedBlackTree) Flip Uses

func (tree *RedBlackTree) Flip(comparator ...func(v1, v2 interface{}) int)

Flip exchanges key-value of the tree to value-key. Note that you should guarantee the value is the same type as key, or else the comparator would panic.

If the type of value is different with key, you pass the new <comparator>.

func (*RedBlackTree) Floor Uses

func (tree *RedBlackTree) Floor(key interface{}) (floor *RedBlackTreeNode, found bool)

Floor Finds floor node of the input key, return the floor node or nil if no floor node is found. Second return parameter is true if floor was found, otherwise false.

Floor node is defined as the largest node that its key is smaller than or equal to the given <key>. A floor node may not be found, either because the tree is empty, or because all nodes in the tree are larger than the given node.

func (*RedBlackTree) Get Uses

func (tree *RedBlackTree) Get(key interface{}) (value interface{})

Get searches the node in the tree by <key> and returns its value or nil if key is not found in tree.

func (*RedBlackTree) GetOrSet Uses

func (tree *RedBlackTree) GetOrSet(key interface{}, value interface{}) interface{}

GetOrSet returns the value by key, or set value with given <value> if not exist and returns this value.

func (*RedBlackTree) GetOrSetFunc Uses

func (tree *RedBlackTree) GetOrSetFunc(key interface{}, f func() interface{}) interface{}

GetOrSetFunc returns the value by key, or sets value with return value of callback function <f> if not exist and returns this value.

func (*RedBlackTree) GetOrSetFuncLock Uses

func (tree *RedBlackTree) GetOrSetFuncLock(key interface{}, f func() interface{}) interface{}

GetOrSetFuncLock returns the value by key, or sets value with return value of callback function <f> if not exist and returns this value.

GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function <f> with mutex.Lock of the hash map.

func (*RedBlackTree) GetVar Uses

func (tree *RedBlackTree) GetVar(key interface{}) *gvar.Var

GetVar returns a gvar.Var with the value by given <key>. The returned gvar.Var is un-concurrent safe.

func (*RedBlackTree) GetVarOrSet Uses

func (tree *RedBlackTree) GetVarOrSet(key interface{}, value interface{}) *gvar.Var

GetVarOrSet returns a gvar.Var with result from GetVarOrSet. The returned gvar.Var is un-concurrent safe.

func (*RedBlackTree) GetVarOrSetFunc Uses

func (tree *RedBlackTree) GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var

GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc. The returned gvar.Var is un-concurrent safe.

func (*RedBlackTree) GetVarOrSetFuncLock Uses

func (tree *RedBlackTree) GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var

GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock. The returned gvar.Var is un-concurrent safe.

func (*RedBlackTree) IsEmpty Uses

func (tree *RedBlackTree) IsEmpty() bool

IsEmpty returns true if tree does not contain any nodes.

func (*RedBlackTree) Iterator Uses

func (tree *RedBlackTree) Iterator(f func(key, value interface{}) bool)

Iterator is alias of IteratorAsc.

func (*RedBlackTree) IteratorAsc Uses

func (tree *RedBlackTree) IteratorAsc(f func(key, value interface{}) bool)

IteratorAsc iterates the tree in ascending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.

func (*RedBlackTree) IteratorDesc Uses

func (tree *RedBlackTree) IteratorDesc(f func(key, value interface{}) bool)

IteratorDesc iterates the tree in descending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.

func (*RedBlackTree) Keys Uses

func (tree *RedBlackTree) Keys() []interface{}

Keys returns all keys in asc order.

func (*RedBlackTree) Left Uses

func (tree *RedBlackTree) Left() *RedBlackTreeNode

Left returns the left-most (min) node or nil if tree is empty.

func (*RedBlackTree) Map Uses

func (tree *RedBlackTree) Map() map[interface{}]interface{}

Map returns all key-value items as map.

func (*RedBlackTree) MarshalJSON Uses

func (tree *RedBlackTree) MarshalJSON() ([]byte, error)

MarshalJSON implements the interface MarshalJSON for json.Marshal.

func (*RedBlackTree) Print Uses

func (tree *RedBlackTree) Print()

Print prints the tree to stdout.

func (*RedBlackTree) Remove Uses

func (tree *RedBlackTree) Remove(key interface{}) (value interface{})

Remove removes the node from the tree by <key>.

func (*RedBlackTree) Removes Uses

func (tree *RedBlackTree) Removes(keys []interface{})

Removes batch deletes values of the tree by <keys>.

func (*RedBlackTree) Right Uses

func (tree *RedBlackTree) Right() *RedBlackTreeNode

Right returns the right-most (max) node or nil if tree is empty.

func (*RedBlackTree) Search Uses

func (tree *RedBlackTree) Search(key interface{}) (value interface{}, found bool)

Search searches the tree with given <key>. Second return parameter <found> is true if key was found, otherwise false.

func (*RedBlackTree) Set Uses

func (tree *RedBlackTree) Set(key interface{}, value interface{})

Set inserts key-value item into the tree.

func (*RedBlackTree) SetIfNotExist Uses

func (tree *RedBlackTree) SetIfNotExist(key interface{}, value interface{}) bool

SetIfNotExist sets <value> to the map if the <key> does not exist, then return true. It returns false if <key> exists, and <value> would be ignored.

func (*RedBlackTree) SetIfNotExistFunc Uses

func (tree *RedBlackTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool

SetIfNotExistFunc sets value with return value of callback function <f>, then return true. It returns false if <key> exists, and <value> would be ignored.

func (*RedBlackTree) SetIfNotExistFuncLock Uses

func (tree *RedBlackTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool

SetIfNotExistFuncLock sets value with return value of callback function <f>, then return true. It returns false if <key> exists, and <value> would be ignored.

SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that it executes function <f> with mutex.Lock of the hash map.

func (*RedBlackTree) Sets Uses

func (tree *RedBlackTree) Sets(data map[interface{}]interface{})

Sets batch sets key-values to the tree.

func (*RedBlackTree) Size Uses

func (tree *RedBlackTree) Size() int

Size returns number of nodes in the tree.

func (*RedBlackTree) String Uses

func (tree *RedBlackTree) String() string

String returns a string representation of container.

func (*RedBlackTree) Values Uses

func (tree *RedBlackTree) Values() []interface{}

Values returns all values in asc order based on the key.

type RedBlackTreeNode Uses

type RedBlackTreeNode struct {
    Key   interface{}
    Value interface{}
    // contains filtered or unexported fields
}

RedBlackTreeNode is a single element within the tree.

Package gtree imports 6 packages (graph) and is imported by 2 packages. Updated 2019-07-13. Refresh now. Tools for package owners.