redblack

package
v0.0.0-...-7997779 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element interface {
	Key() int
	Merge(Element) Element
}

Element represents the constituent of any Node

type Node

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

Node is what the tree is made of.

func Root

func Root(e Element) *Node

Root returns (the root of) a fresh Red-Black Tree

func (*Node) Fold

func (tree *Node) Fold(init interface{}, f ducer) (interface{}, bool)

func (*Node) Insert

func (tree *Node) Insert(e Element) *Node

Insert an Element

func (*Node) Locate

func (tree *Node) Locate(n int) (Element, bool)

Locate an Element given it's Key()

Jump to

Keyboard shortcuts

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