#trie #prefix-tree #retrieval-tree #digital-tree

dyn_trie

Dynamic trie is trie capable of mapping any T to any string

7 stable releases

new 1.1.1 Jan 19, 2025
1.1.0 Jan 13, 2025
1.0.5 Dec 15, 2024
1.0.4 Oct 21, 2024
1.0.2 Jul 22, 2024

#1802 in Data structures

Download history 138/week @ 2024-10-16 35/week @ 2024-10-23 7/week @ 2024-10-30 7/week @ 2024-11-06 1/week @ 2024-11-13 2/week @ 2024-12-04 109/week @ 2024-12-11 16/week @ 2024-12-18 152/week @ 2025-01-08 161/week @ 2025-01-15

313 downloads per month

MIT license

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.

No runtime deps