Skip to content
/ btrie Public

An in-memory binary Trie implementation (also called radix or prefix trees)

License

Notifications You must be signed in to change notification settings

bdargham/btrie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

btrie

Build Status Coverage Status

An in-memory binary Trie implementation (also called radix or prefix trees)

Simple usage example


import (
	"fmt"
	"github.com/bdargham/btrie"
)

func main() {

	trie := btrie.New()

	trie.SPut("perf", "When things go fast")
	trie.SPut("winter", "... when it's really cold")
	trie.SPut("fall", "Autumn")
	trie.SPut("win", "We don't want to lose... ")
	trie.SPut("fallout", "Mushroom cloud")

	dfsOpts := btrie.TraversalOpts{From: []byte("w")}
	for cursor := trie.Traverse(dfsOpts); cursor.HasNext(); {
		fmt.Println(cursor.Next().Value())
	}
}

About

An in-memory binary Trie implementation (also called radix or prefix trees)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages