Documentation ¶
Index ¶
Constants ¶
View Source
const TrieBase = 2
Variables ¶
View Source
var BitsPerByte = 8
http://www.cs.yale.edu/homes/aspnes/pinewiki/RadixSearch.html?highlight=%28CategoryAlgorithmNotes%29 PerByte = 8
Functions ¶
func TrieContains ¶
Types ¶
type Edge ¶
Edge represents the edge of a node.
type Node ¶
type Node struct {
Edges []Edge
}
Node holds an array of edge.
type Root ¶
type Root struct {
Node Node
}
Root represents the root of the radix tree.
func (*Root) FindRecursive ¶
type TernaryNode ¶
type TernaryNode struct {
// contains filtered or unexported fields
}
func NewTernaryNode ¶
func NewTernaryNode(char rune, endword bool) *TernaryNode
type TernaryTree ¶
type TernaryTree struct {
// contains filtered or unexported fields
}
func NewTernaryTree ¶
func NewTernaryTree() *TernaryTree
func (*TernaryTree) Add ¶
func (t *TernaryTree) Add(s string)
Add adds the item to the tree recursively.
func (*TernaryTree) Contains ¶
func (t *TernaryTree) Contains(str string) bool
func (*TernaryTree) Search ¶
func (t *TernaryTree) Search(str string) (result []string)
Search implements an autocomplete for ternary search tree.
func (*TernaryTree) Traverse ¶
func (t *TernaryTree) Traverse() (result []string)
type TrieNode ¶
type TrieNode struct {
// contains filtered or unexported fields
}
func NewTrieNode ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.