MCPcopy Create free account
hub / github.com/douchuan/algorithm / TrieST

Class TrieST

src/strings/tries.rs:53–56  ·  view source on GitHub ↗

The TrieST represents an symbol table of key-value pairs, with string keys and generic values. It supports the usual put, get, contains, delete, len, and is-empty, methods. It also provides character-based methods for finding the string in the symbol table that is the *longest prefix* of a given prefix, finding all strings in the symbol table that s*tart with* a given prefix, and finding all strin

Source from the content-addressed store, hash-verified

51/// The len, and is-empty operations take constant time.
52/// Construction takes constant time.
53pub struct TrieST<T> {
54 root: Option<NonNull<Node<T>>>,
55 n: usize,
56}
57
58struct Node<T> {
59 val: Option<T>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected