Watch
1
0
Fork
You've already forked rust-ab-radix-trie
0
No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Baumann 612499c510
Updating to debhelper 14.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2026-06-14 12:50:39 +02:00
.github/workflows Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
debian Updating to debhelper 14. 2026-06-14 12:50:39 +02:00
examples Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
src Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
tests Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
.cargo_vcs_info.json Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
.gitignore Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
Cargo.lock Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
Cargo.toml Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
Cargo.toml.orig Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
LICENSE Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00
README.md Adding upstream version 0.2.1. 2025-12-31 13:32:49 +01:00

Latest Version

Radix-Trie

Radix-trie implementation i.e. compressed prefix-trie

https://en.wikipedia.org/wiki/Radix_tree

Some nice features:

  1. Compressed nodes
  2. Fuzzy matching - match on whitespace, replacing characters, etc.
  3. Supports all unicode characters
  4. Arbitrarily associate values to text (i.e. map strings to values)
  5. Serializable with serde

Performance

Approximately:

  1. insertion O(depth of trie)
  2. retrieval O(depth of trie)
  3. deletion O(depth of trie)
  4. Space - I don't know really, but it will behave according to ~O(entropy of text) - Similar texts are compressed together - i.e. "ABC", "ABCD" will occupy O("ABCD") space split into "ABC" and "D"

Usage:

I suggest checking out the examples and the tests for some patterns

The basic usage is along these lines

let mut trie: Trie<i32> = Trie::new();
trie.insert("romanus", None);
trie.insert("romulus", Some(10));
trie.insert("rubens", None);
trie.insert("ruber", None);
trie.insert("rubicon", None);
trie.insert("rubicundus", None);