Trie
The Trie data structure is a tree-like data structure used for storing a dynamic set of strings. It is commonly used for efficient retrieval and storage of keys in a large dataset.
Operations
- insert: Adds a word to the Trie.
- remove: Removes a word from the Trie.
- has: Checks if a word exists in the Trie.
- startsWith: Checks if a prefix exists in the Trie.
- clear: Empty the trie.
- toArray: Convert a trie to an array.
APIs
Constructor
fromArray (static)
toArray
Ultify's trie also supports Iteration Protocol so you can iterate through every word of a Trie.