tst

package
v0.0.0-...-604e922 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2013 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

func (*Node) String

func (this *Node) String() string

Dump the tree to a string for easier debugging

type NodeIterator

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

type TernarySearchTree

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

func New

func New() *TernarySearchTree

Create a new ternary search tree

func (*TernarySearchTree) Do

func (this *TernarySearchTree) Do(callback func(string, interface{}) bool)

Iterate over the collection

func (*TernarySearchTree) Get

func (this *TernarySearchTree) Get(key string) interface{}

Get the value at the specified key. Returns nil if not found.

func (*TernarySearchTree) GetLongestPrefix

func (this *TernarySearchTree) GetLongestPrefix(key string) interface{}

func (*TernarySearchTree) Has

func (this *TernarySearchTree) Has(key string) bool

Test to see whether or not the given key is contained in the tree.

func (*TernarySearchTree) Init

func (this *TernarySearchTree) Init()

Initialize the tree (reset it so that it's empty). New will do this for you.

func (*TernarySearchTree) Insert

func (this *TernarySearchTree) Insert(key string, value interface{})

Insert a new key value pair into the collection

func (*TernarySearchTree) Len

func (this *TernarySearchTree) Len() int

Get the number of items stored in the tree

func (*TernarySearchTree) Remove

func (this *TernarySearchTree) Remove(key string) interface{}

Remove a key from the collection

func (*TernarySearchTree) String

func (this *TernarySearchTree) String() string

Jump to

Keyboard shortcuts

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