Documentation ¶
Index ¶
- type NodeIterator
- func (i *NodeIterator[K, V]) Begin()
- func (i *NodeIterator[K, V]) End()
- func (i *NodeIterator[K, V]) First() bool
- func (i *NodeIterator[K, V]) Key() K
- func (i *NodeIterator[K, V]) Last() bool
- func (i *NodeIterator[K, V]) Next() bool
- func (i *NodeIterator[K, V]) Prev() bool
- func (i *NodeIterator[K, V]) Value() V
- type RedBlack
- func (t *RedBlack[K, V]) Clear()
- func (t *RedBlack[K, V]) Empty() bool
- func (t *RedBlack[K, V]) Get(key K) (V, bool)
- func (t *RedBlack[K, V]) Iterator() NodeIterator[K, V]
- func (t *RedBlack[K, V]) Keys() []K
- func (t *RedBlack[K, V]) Left() (V, bool)
- func (t *RedBlack[K, V]) Put(key K, value V)
- func (t *RedBlack[K, V]) Remove(key K)
- func (t *RedBlack[K, V]) Right() (V, bool)
- func (t *RedBlack[K, V]) Size() int
- func (t *RedBlack[K, V]) Values() []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeIterator ¶
type NodeIterator[K comparable, V any] struct { // contains filtered or unexported fields }
func (*NodeIterator[K, V]) Begin ¶
func (i *NodeIterator[K, V]) Begin()
func (*NodeIterator[K, V]) End ¶
func (i *NodeIterator[K, V]) End()
func (*NodeIterator[K, V]) First ¶
func (i *NodeIterator[K, V]) First() bool
Note: you can immediately call Key() and Value() after calling First()
func (*NodeIterator[K, V]) Key ¶
func (i *NodeIterator[K, V]) Key() K
func (*NodeIterator[K, V]) Last ¶
func (i *NodeIterator[K, V]) Last() bool
Note: you can immediately call Key() and Value() after calling Last()
func (*NodeIterator[K, V]) Next ¶
func (i *NodeIterator[K, V]) Next() bool
Note: this must be called first if we are at the beginning, otherwise it will panic
func (*NodeIterator[K, V]) Prev ¶
func (i *NodeIterator[K, V]) Prev() bool
Note: this must be called first if we are at the end, otherwise it will panic
func (*NodeIterator[K, V]) Value ¶
func (i *NodeIterator[K, V]) Value() V
type RedBlack ¶
type RedBlack[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRedBlack ¶
func NewRedBlack[K comparable, V any](comparator func(a, b K) int) *RedBlack[K, V]
TODO - rely on custom red black tree implementation
func (*RedBlack[K, V]) Iterator ¶
func (t *RedBlack[K, V]) Iterator() NodeIterator[K, V]
Click to show internal directories.
Click to hide internal directories.