A simple npm package that allows you to build and manipulate a prefix trie
Check out the instructions below for setting up perfect-trie!
To install perfect-trie, use the command below:
npm install perfect-trie --save
Returns the prefix of the specified node
Returns any children of the specified node
Returns true if specified node has a complete prefix
Adds the word to the trie and as a result, produces child nodes
var root = new Node ('');
root.addWord('tea');
Returns the node of the given prefix or null if not found
var root = new Node ('');
root.addWord('tea');
var node = root.find('te');
Returns an array of words that start with the prefix of the specified node
Thank you to Buddhike de Silva for reviewing my documentation