Socket
Book a DemoInstallSign in
Socket

github.com/bdargham/btrie

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/bdargham/btrie

Source
Go
Version
v0.0.0-20180131093309-ce0a465b8eb0
Version published
Created
Source

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())
	}
}

FAQs

Package last updated on 31 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts