[][src]Crate patricia_tree

Memory-efficient data structures based on patricia tree (a.k.a, radix tree).

A common prefixes of the keys in a patricia tree are represented by a shared path. So if the prefixes of the key set is highly redundant, the memory usage of the resulting patricia tree will be drastically less than more generic data structures (e.g., BTreeMap).

See Radix tree for more details.

Examples

use patricia_tree::PatriciaMap;

let mut map = PatriciaMap::new();
map.insert("foo", 1);
map.insert("bar", 2);
map.insert("baz", 3);
assert_eq!(map.len(), 3);

assert_eq!(map.get("foo"), Some(&1));
assert_eq!(map.get("bar"), Some(&2));
assert_eq!(map.get("baz"), Some(&3));

Re-exports

pub use map::PatriciaMap;
pub use set::PatriciaSet;

Modules

map

A map based on a patricia tree.

node

A node which represents a subtree of a patricia tree.

set

A set based on a patricia tree.