bst

package
v0.0.0-...-736f5eb Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2015 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IterOnTree

func IterOnTree(n *Node, f func(*Node)) bool

Types

type Node

type Node struct {
	Value  int
	Parent *Node
	Left   *Node
	Right  *Node
}

func NewNode

func NewNode(i int) *Node

func (*Node) Compare

func (n *Node) Compare(m *Node) int

type Tree

type Tree struct {
	Head *Node
	Size int
}

func NewTree

func NewTree(n *Node) *Tree

func (*Tree) Delete

func (t *Tree) Delete(i int) bool

returns true if a node with value i was found and deleted and returns false otherwise

func (*Tree) Insert

func (t *Tree) Insert(i int)

func (*Tree) Search

func (t *Tree) Search(i int) *Node

Jump to

Keyboard shortcuts

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