trie

package
v0.0.0-...-317c7f9 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2013 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

package trie

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

type Trie struct {
	// contains filtered or unexported fields
}

Trie implements an append-only trie for ascii strings

func NewTrie

func NewTrie() *Trie

Create a new trie

func (*Trie) Add

func (t *Trie) Add(s string) int

Add a string to the trie, returning the resulting occurances of the string

func (*Trie) Count

func (t *Trie) Count(s string) int

Get the number of occurances of string s in the trie

func (*Trie) NumPrefixed

func (t *Trie) NumPrefixed(s string) int

Get the number of strings in the trie prefixed with s

func (*Trie) NumPrefixedOfLength

func (t *Trie) NumPrefixedOfLength(s string, n int) int

Get the number of strings in the trie prefixed with s with length N

func (*Trie) Total

func (t *Trie) Total() (total int)

Get the number of strings in the trie

func (*Trie) TotalOfLength

func (t *Trie) TotalOfLength(n int) (total int)

Get the number of strings in the trie of length n

Jump to

Keyboard shortcuts

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