tree

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const MAXCAP = 26 // a-z

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

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

func NewTrie

func NewTrie() Trie

* Initialize your data structure here.

func (*Trie) Insert

func (this *Trie) Insert(word string)

* Inserts a word into the trie.

func (*Trie) Search

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

* Returns if the word is in the trie.

func (*Trie) StartsWith

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

* 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