trie-obj

1.0.1 • Public • Published

trie-obj

a fun to use implementation of the trie data structure

not optimized for common suffixes, etc. Feel free to submit PRs

Usage

const Trie = require('trie-obj')
const trie = Trie.create()
// set key->value mappings as you would on a regular object
trie.hello = 'world'
trie.helicon = 'another world'
// lookup by prefix
console.log(trie.he)
// ['world', 'another world']
 
console.log(trie.hello)
// ['world']
 
// delete as you would from a regular object
delete trie.helicon
console.log(trie.he)
// ['world']

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    12
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    12
  • 1.0.0
    0

Package Sidebar

Install

npm i trie-obj

Weekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

3.5 kB

Total Files

6

Last publish

Collaborators

  • tenaciousmv