trie

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Path  string  // substring from the path "owned" by the node
	Heir  []*Node // heir nodes
	Level slog.Level
}

Node of trie

func New

func New() *Node

New creates new trie

func (*Node) Append

func (root *Node) Append(path string, level slog.Level)

func (*Node) Lookup

func (root *Node) Lookup(path string) (at int, node *Node)

lookup is hot-path discovery of node at the path

func (*Node) Println

func (root *Node) Println()

Println outputs trie to console

func (*Node) Walk

func (root *Node) Walk(f func(int, *Node))

Walk through trie, use for debug purposes only

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL