trie

package
v0.0.0-...-2ecbb9b Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package trie implements a simple trie tree for minio server/tools borrows idea from - https://godoc.org/golang.org/x/text/internal/triegen.

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
}

Node trie tree node container carries value and children.

type Trie

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

Trie is a trie container.

func NewTrie

func NewTrie() *Trie

NewTrie create a new trie.

func (*Trie) Insert

func (t *Trie) Insert(key string)

Insert insert a key.

func (*Trie) PrefixMatch

func (t *Trie) PrefixMatch(key string) []interface{}

PrefixMatch - prefix match.

func (*Trie) Root

func (t *Trie) Root() *Node

Root returns root node.

func (*Trie) Walk

func (t *Trie) Walk(node *Node) (ret []interface{})

Walk the tree.

Jump to

Keyboard shortcuts

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