7 stable releases
new 1.1.1 | Jan 19, 2025 |
---|---|
1.1.0 |
|
1.0.5 | Dec 15, 2024 |
1.0.4 | Oct 21, 2024 |
1.0.2 | Jul 22, 2024 |
#1802 in Data structures
313 downloads per month
23KB
536 lines
Dynamic Trie
Dynamic trie is trie that allows mapping of any T to any string with asymptotical computational complexity based on that of std::collections::HashMap
.
Node occurs for each char
in string as defined by Rust language.
let mut trie = Trie::<char>::new();
let some = Key("información meteorológica");
trie.insert('🌩', &some);
let one_more = Key("alimentación RSS");
trie.insert('😋', &one_more);
assert!(trie.delete(&one_more).is_ok());
assert!(trie.member(&one_more).is_none());
assert_eq!(Some(&'🌩'), trie.member(&some));
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.