rbt

package
v0.0.0-...-11ada09 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RED   = Color(0)
	BLACK = Color(1)
)
View Source
const (
	INT_MAX = math.MaxInt64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color int

type Node

type Node struct {
	// contains filtered or unexported fields
}

func FindPredecessor

func FindPredecessor(n *Node) *Node

func FindSuccessor

func FindSuccessor(n *Node) *Node

func (*Node) GetKey

func (n *Node) GetKey() int64

func (*Node) GetValue

func (n *Node) GetValue() string

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

func NewTree

func NewTree() *Tree

func (*Tree) Delete

func (t *Tree) Delete(key int64)

func (*Tree) Insert

func (t *Tree) Insert(key int64, value string)

func (*Tree) Minimum

func (t *Tree) Minimum() *Node

func (*Tree) Nearest

func (t *Tree) Nearest(key int64) *Node

func (*Tree) Preorder

func (t *Tree) Preorder()

Preorder prints the tree in pre order

func (*Tree) Root

func (t *Tree) Root() *Node

func (*Tree) Search

func (t *Tree) Search(key int64) *Node

func (*Tree) Size

func (t *Tree) Size() int

func (*Tree) Traverse

func (t *Tree) Traverse()

Inorder traversal

Jump to

Keyboard shortcuts

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