solution

package
v0.0.0-...-291ea56 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 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 Trie

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

Trie represents a structure of trie node

func Constructor

func Constructor() Trie

Constructor initializes a trie node.

func (*Trie) Insert

func (t *Trie) Insert(word string)

Insert adds a word into the trie.

func (*Trie) Search

func (t *Trie) Search(word string) bool

Search returns if the word is in the trie.

func (*Trie) StartsWith

func (t *Trie) StartsWith(prefix string) bool

StartsWith returns if there is any word in the trie that starts with the given prefix.

Jump to

Keyboard shortcuts

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