ds-trie

1.0.6 • Public • Published

ds-trie

A dead-simple trie data structure for JavaScript

Usage:

const Trie = require('ds-trie');
const assert = require('assert');

const t = new Trie();

t.addElement(['path', 'a'], 'something');
t.addElements(['path', 'b'], ['other', 'stuff']);
t.removeElement(['path', 'b'], 'other');

t.addElement(['path'], 'root');

assert.deepStrictEqual(t.collect(['path', 'b']), ['stuff', 'root']);

Readme

Keywords

Package Sidebar

Install

npm i ds-trie

Weekly Downloads

8

Version

1.0.6

License

MIT

Unpacked Size

7.46 kB

Total Files

4

Last publish

Collaborators

  • kendru