The trie (i.e., from "retrieval") data structure was invented by Edward Fredkin (it is a form of radix sort). The implementation stores string suffixes as a list because it is a PATRICIA trie (PATRICIA - Practical Algorithm to Retrieve Information Coded in Alphanumeric, D.R.Morrison (1968)).
This Erlang trie implementation uses binary keys.Copyright © 2010-2020 Michael Truog
Version: 2.0.1 Oct 11 2022 18:58:21 ------------------------------------------------------------------------
Authors: Michael Truog (mjtruog at protonmail dot com).
The trie (i.e., from "retrieval") data structure was invented by Edward Fredkin (it is a form of radix sort). The implementation stores string suffixes as a list because it is a PATRICIA trie (PATRICIA - Practical Algorithm to Retrieve Information Coded in Alphanumeric, D.R.Morrison (1968)).
This Erlang trie implementation uses binary keys. Using binary keys means that other data structures are quicker alternatives, so this module is probably not a good choice, unless it is used for functions not available elsewhere.empty_trie() = <<>>
nonempty_trie() = {integer(), integer(), tuple()}
trie() = nonempty_trie() | empty_trie()
append(Key::<<_:8, _:_*8>>, Value::any(), Node::trie()) -> nonempty_trie()
append_list(Key::<<_:8, _:_*8>>, ValueList::list(), Node::trie()) -> nonempty_trie()
erase_similar(Similar::<<_:8, _:_*8>>, Node::trie()) -> [<<_:8, _:_*8>>]
fetch(X1::<<_:8, _:_*8>>, Node::nonempty_trie()) -> any()
fetch_keys(Node::trie()) -> [<<_:8, _:_*8>>]
fetch_keys_similar(Similar::<<_:8, _:_*8>>, Node::trie()) -> [<<_:8, _:_*8>>]
find(X1::<<_:8, _:_*8>>, Node::trie()) -> {ok, any()} | error
find_prefix(X1::<<_:8, _:_*8>>, X2::trie()) -> {ok, any()} | prefix | error
find_prefix_longest(Match::<<_:8, _:_*8>>, Node::trie()) -> {ok, <<_:8, _:_*8>>, any()} | error
find_prefixes(Match::<<_:8, _:_*8>>, Node::trie()) -> [{<<_:8, _:_*8>>, any()}]
fold(F::fun((<<_:8, _:_*8>>, any(), any()) -> any()), A::any(), Node::trie()) -> any()
fold_similar(Similar::<<_:8, _:_*8>>, F::fun((<<_:8, _:_*8>>, any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldl(F::fun((<<_:8, _:_*8>>, any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldl_similar(Similar::<<_:8, _:_*8>>, F::fun((<<_:8, _:_*8>>, any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldr(F::fun((<<_:8, _:_*8>>, any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldr_similar(Similar::<<_:8, _:_*8>>, F::fun((<<_:8, _:_*8>>, any(), any()) -> any()), A::any(), Node::trie()) -> any()
foreach(F::fun((<<_:8, _:_*8>>, any()) -> any()), Node::trie()) -> any()
from_list(L::[<<_:8, _:_*8>> | tuple()]) -> trie()
is_key(X1::<<_:8, _:_*8>>, Node::trie()) -> boolean()
new() -> empty_trie()
new(L::[<<_:8, _:_*8>> | tuple()]) -> trie()
prefix(Key::<<_:8, _:_*8>>, Value::any(), Node::trie()) -> nonempty_trie()
size(Node::trie()) -> non_neg_integer()
store(Key::<<_:8, _:_*8>>, Node::trie()) -> nonempty_trie()
store(Key::<<_:8, _:_*8>>, NewValue::any(), Node::trie()) -> nonempty_trie()
to_list(Node::trie()) -> [{<<_:8, _:_*8>>, any()}]
to_list_similar(Similar::<<_:8, _:_*8>>, Node::trie()) -> [{<<_:8, _:_*8>>, any()}]
update(X1::<<_:8, _:_*8>>, F::fun((any()) -> any()), Node::nonempty_trie()) -> nonempty_trie()
update(Key::<<_:8, _:_*8>>, F::fun((any()) -> any()), Initial::any(), Node::trie()) -> nonempty_trie()
update_counter(Key::<<_:8, _:_*8>>, Increment::number(), Node::trie()) -> nonempty_trie()
Generated by EDoc