rbtree

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 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 RBTree

type RBTree[K, V any] struct {
	// contains filtered or unexported fields
}

RBTree is a red-black tree

func NewRBTree

func NewRBTree[K, V any](less cmp.LessFunc[K]) *RBTree[K, V]

NewRBTree creates a red-black tree

func (*RBTree[K, V]) Del

func (t *RBTree[K, V]) Del(key K)

Del deletes the stored value by given key

func (*RBTree[K, V]) Get

func (t *RBTree[K, V]) Get(key K) (V, bool)

Get returns the stored value by given key

func (*RBTree[K, V]) Len

func (t *RBTree[K, V]) Len() int

Len returns the size of the tree

func (*RBTree[K, V]) Put

func (t *RBTree[K, V]) Put(key K, value V)

Put stores the value by given key

func (*RBTree[K, V]) String

func (t *RBTree[K, V]) String() string

Jump to

Keyboard shortcuts

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