Documentation ¶
Index ¶
- type AVLTree
- func (bst *AVLTree[K, T]) FloorCeil(key K) (floorIt, ceilIt Iterator[K, T])
- func (bst *AVLTree[K, T]) InOrderTraverse(f func(T))
- func (bst *AVLTree[K, T]) Insert(key K, value T)
- func (bst *AVLTree[K, T]) Max() Iterator[K, T]
- func (bst *AVLTree[K, T]) Min() Iterator[K, T]
- func (bst *AVLTree[K, T]) PostOrderTraverse(f func(T))
- func (bst *AVLTree[K, T]) PreOrderTraverse(f func(T))
- func (bst *AVLTree[K, T]) Remove(key K)
- func (bst *AVLTree[K, T]) Search(key K) Iterator[K, T]
- func (bst *AVLTree[K, T]) Size() int
- func (bst *AVLTree[K, T]) String()
- type Iterator
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AVLTree ¶
type AVLTree[K constraints.Ordered, T any] struct { // contains filtered or unexported fields }
AVLTree the binary search tree of Items
func (*AVLTree[K, T]) InOrderTraverse ¶
func (bst *AVLTree[K, T]) InOrderTraverse(f func(T))
InOrderTraverse visits all nodes with in-order traversing
func (*AVLTree[K, T]) Insert ¶
func (bst *AVLTree[K, T]) Insert(key K, value T)
Insert inserts the Item t in the tree
func (*AVLTree[K, T]) PostOrderTraverse ¶
func (bst *AVLTree[K, T]) PostOrderTraverse(f func(T))
PostOrderTraverse visits all nodes with post-order traversing
func (*AVLTree[K, T]) PreOrderTraverse ¶
func (bst *AVLTree[K, T]) PreOrderTraverse(f func(T))
PreOrderTraverse visits all nodes with pre-order traversing
func (*AVLTree[K, T]) Remove ¶
func (bst *AVLTree[K, T]) Remove(key K)
Remove removes the Item with key `key` from the tree
type Iterator ¶
type Iterator[K constraints.Ordered, T any] struct { // contains filtered or unexported fields }
type Node ¶
type Node[K constraints.Ordered, T any] struct { // contains filtered or unexported fields }
Node a single node that composes the tree
Click to show internal directories.
Click to hide internal directories.