A RadixTree (or Patricia Trie) is a space-optimized trie that allows for efficient retrieval of keys by compressing common prefixes. It is particularly useful for storing strings and performing prefix searches.
import { RadixTree } from "collection-kit";
import { RadixTree } from "collection-kit";
const tree = new RadixTree();
tree.insert("romane");
tree.insert("romanus");
tree.insert("romulus");
console.log(tree.search("romane")); // true
console.log(tree.search("roman")); // false