tree

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 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 Node

type Node[K constraints.Ordered, V any] struct {
	Value V
	// contains filtered or unexported fields
}

Node structure

type Tree

type Tree[K constraints.Ordered, V any] struct {
	// contains filtered or unexported fields
}

AVL Tree (balanced tree) structure. Public methods are Add, Remove, Update, Search, DisplayTreeInOrder.

func (*Tree[K, V]) Add

func (t *Tree[K, V]) Add(key K, value V)

func (*Tree[K, V]) DisplayInOrder

func (t *Tree[K, V]) DisplayInOrder()

func (*Tree[K, V]) Remove

func (t *Tree[K, V]) Remove(key K)

func (*Tree[K, V]) Search

func (t *Tree[K, V]) Search(key K) (node *Node[K, V])

func (*Tree[K, V]) Update

func (t *Tree[K, V]) Update(oldKey K, newKey K, newValue V)

Jump to

Keyboard shortcuts

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