Documentation
¶
Index ¶
Constants ¶
View Source
const ( RED = 0 BLACK = 1 )
color of node
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tree ¶
type Tree[K Ordered, V any] struct { // contains filtered or unexported fields }
Tree is a struct of red-black tree.
func (*Tree[K, V]) Find ¶
func (t *Tree[K, V]) Find(key K) V
Find finds the node and return its value.
func (*Tree[K, V]) FindIt ¶
func (t *Tree[K, V]) FindIt(key K) *node[K, V]
FindIt finds the node and return it as an iterator.
func (*Tree[K, V]) Insert ¶
func (t *Tree[K, V]) Insert(key K, value V)
Insert inserts the key-value pair into the rbtree.
Click to show internal directories.
Click to hide internal directories.