@datastructures-js/trie
Version:
trie implementation in javascript
15 lines (13 loc) • 452 B
TypeScript
import { TrieNode } from './trieNode';
export class Trie {
insert(value: { toString: () => string }): Trie;
has(value: { toString: () => string }): boolean;
find(value: { toString: () => string }): TrieNode;
remove(value: { toString: () => string }): string|null;
forEach(cb: (word: string) => void): void;
toArray(): string[];
nodesCount(): number;
wordsCount(): number;
clear(): void;
static fromArray(words: string[]): Trie;
}