es-next-tools
Version:
A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.
18 lines (17 loc) • 430 B
TypeScript
/**
* Represents a Trie (prefix tree).
*/
export declare class Trie {
private root;
/**
* Inserts a word into the Trie.
* @param {string} word - The word to insert.
*/
insert(word: string): void;
/**
* Searches for a word in the Trie.
* @param {string} word - The word to search for.
* @returns {boolean} True if found, false otherwise.
*/
search(word: string): boolean;
}