Trie Data Structure with Frequency Information for node.js