Crates.io | very_simple_trie |
lib.rs | very_simple_trie |
version | 0.1.3 |
source | src |
created_at | 2024-07-03 21:52:47.130027 |
updated_at | 2024-07-03 21:52:47.130027 |
description | A Trie or prefix tree is a specialized tree-like data structure used for efficient storage. |
homepage | |
repository | |
max_upload_size | |
id | 1291022 |
size | 6,781 |
A Trie (pronounced "try") or prefix tree is a specialized tree-like data structure used for efficient storage and retrieval of strings. It provides fast operations for prefix-based searches and is particularly useful in applications like autocomplete, spell checking, and IP routing.
[dependencies]
simple_trie = "0.1.0"
use simple_trie::Trie;
let mut my_trie = Trie::new();
my_trie.insert("hello");
my_trie.insert("world");
my_trie.insert("help");
// Search for a full word
let exists = my_trie.search_full_world("hello"); // true
// Search for a prefix
let prefix_exists = my_trie.search_prefix("hel"); // true
Run tests with:
cargo test
This project is licensed under the MIT License.