14 stable releases
2.3.1 | Feb 16, 2025 |
---|---|
2.3.0 | Feb 6, 2025 |
2.1.1 | Jan 30, 2025 |
1.1.1 | Jan 19, 2025 |
1.0.2 | Jul 22, 2024 |
#1082 in Data structures
879 downloads per month
59KB
1.5K
SLoC
Dynamic Trie
Dynamic trie is trie that allows mapping of any T to any char iterator with asymptotical computational complexity based on that of std::collections::HashMap
.
Node occurs for each char
as defined by Rust language.
let mut trie = Trie::<char>::new();
let some = "información meteorológica".chars();
trie.ins('🌩', some.clone());
let one_more = "alimentación RSS".chars();
trie.ins('😋', one_more.clone());
assert_eq!(RemRes::Ok('😋'), trie.rem(one_more.clone()));
assert_eq!(AcqRes::Err(KeyErr::Unknown), trie.acq(one_more.clone()));
assert_eq!(AcqRes::Ok(&'🌩'), trie.acq(some.clone()));
lib.rs
:
Dynamic trie in contrast to classic trie does not have fixed size alphabet associated with node.
Each node has dynamic alphabet of size as to satisfy exactly associated branches.