trie

package
v0.0.0-...-6b88b7f Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FIFOQueue

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

FIFO queue from https://gist.github.com/moraes/2141121

func NewQueue

func NewQueue(size int) *FIFOQueue

func (*FIFOQueue) Pop

func (q *FIFOQueue) Pop() *TrieNode

Pop removes and returns a node from the queue in first to last order.

func (*FIFOQueue) Push

func (q *FIFOQueue) Push(n *TrieNode)

Push adds a node to the queue.

type TrieNode

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

func NewTrie

func NewTrie() *TrieNode

func (*TrieNode) Count

func (r *TrieNode) Count() int

func (*TrieNode) FindPrefix

func (r *TrieNode) FindPrefix(prefix string, max int) []*TrieNode

func (*TrieNode) Format

func (r *TrieNode) Format() string

func (*TrieNode) Insert

func (r *TrieNode) Insert(word string, origin string)

func (*TrieNode) Origin

func (r *TrieNode) Origin() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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