Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1 KB

README.md

File metadata and controls

39 lines (30 loc) · 1 KB

Multiverse OS Logo

Multiverse OS: radix trie library

URL multiverse-os.org

A simple prefix sorting radix tree designed specifically for working with words, providing fuzzy search functionality, prefix filtering for autocomplete.

Examples

A simple example using the .String() function provided which prints out the current state of the trie.

package main

import (
	"fmt"

	radix "github.com/multiverse-os/cli/radix"
)

func main() {
	fmt.Println("radix trie example")
	fmt.Println("==================")

	tree := radix.New()
	tree.Add("romane", 112)
	tree.Add("romanus", 11)
	tree.Add("tuber", 44)
	tree.Add("romulus", 4)
	tree.Add("ruber", 8)
	tree.Add("tubular", 99)
	tree.Add("rubens", 9)
	tree.Add("tub", 3)
	tree.Add("rubicon", 44)
	tree.Add("rubicundus", 71)

	fmt.Printf("%s", tree.String())
}