Skip to content

alexkappa/trie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trie

Trie implementation in Go. Inspired by John Resig's trie-js.

Motivation

The trie data structure is particularly interresting to me as it's surprisingly simple yet powerful.

The data structure is nothing more than the recursive type type Node map[rune]Node. With this simple type we're able to index words by prefix and perform fast lookups.

Usage

import "github.com/alexkappa/trie"

t := trie.New()
t.Index([]string{"ab", "ac", "ad", "abc"})
t.Search("ab") // ["ab" "abc"]

The API documentation is available at godoc.org.

About

Trie implementation in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages