Documentation ¶
Overview ¶
Package trie provides implementations of trie trees
Example ¶
tr := New() tr.Insert("Test") if tr.Find("Test") { // Found } tr.Remove("Test")
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trie ¶
type Trie interface { // Insert inserts a string into the tree Insert(s string) // Find searches for the given value Find(s string) bool // HasPrefix returns if the tree contains the given prefix HasPrefix(s string) bool // Remove removes an entry if it exists Remove(s string) // PrettyPrint outputs the tree to the given Writer // "" as indent will be replaced by the default value (". ") PrettyPrint(w io.Writer, indent string) }
Trie provides a basic interface for any tree implementation
Click to show internal directories.
Click to hide internal directories.