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-2017 Michael Truog
Version: 1.7.1 Jun 7 2017 09:26:10 ------------------------------------------------------------------------
Authors: Michael Truog (mjtruog [at] gmail (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::binary(), Value::any(), Node::trie()) -> nonempty_trie()
append_list(Key::binary(), ValueList::list(), Node::trie()) -> nonempty_trie()
erase_similar(Similar::binary(), Node::trie()) -> [binary()]
fetch(X1::binary(), Node::nonempty_trie()) -> any()
fetch_keys(Node::trie()) -> [binary()]
fetch_keys_similar(Similar::binary(), Node::trie()) -> [binary()]
find(X1::binary(), Node::trie()) -> {ok, any()} | error
find_prefix(X1::binary(), X2::trie()) -> {ok, any()} | prefix | error
find_prefix_longest(Match::binary(), Node::trie()) -> {ok, binary(), any()} | error
find_prefixes(Match::binary(), Node::trie()) -> [{binary(), any()}]
fold(F::fun((binary(), any(), any()) -> any()), A::any(), Node::trie()) -> any()
fold_similar(Similar::binary(), F::fun((binary(), any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldl(F::fun((binary(), any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldl_similar(Similar::binary(), F::fun((binary(), any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldr(F::fun((binary(), any(), any()) -> any()), A::any(), Node::trie()) -> any()
foldr_similar(Similar::binary(), F::fun((binary(), any(), any()) -> any()), A::any(), Node::trie()) -> any()
foreach(F::fun((binary(), any()) -> any()), Node::trie()) -> any()
from_list(L::list()) -> trie()
is_key(X1::binary(), Node::trie()) -> boolean()
new() -> empty_trie()
new(L::list()) -> trie()
prefix(Key::binary(), Value::any(), Node::trie()) -> nonempty_trie()
size(Node::trie()) -> non_neg_integer()
store(Key::binary(), Node::trie()) -> nonempty_trie()
store(Key::binary(), NewValue::any(), Node::trie()) -> nonempty_trie()
to_list(Node::trie()) -> [{binary(), any()}]
to_list_similar(Similar::binary(), Node::trie()) -> [{binary(), any()}]
update(X1::binary(), F::fun((any()) -> any()), Node::nonempty_trie()) -> nonempty_trie()
update(Key::binary(), F::fun((any()) -> any()), Initial::any(), Node::trie()) -> nonempty_trie()
update_counter(Key::binary(), Increment::number(), Node::trie()) -> nonempty_trie()
Generated by EDoc, Jun 7 2017, 09:26:10.