@smikhalevski/trie

The compact trie data structure.

Usage no npm install needed!

<script type="module">
  import smikhalevskiTrie from 'https://cdn.skypack.dev/@smikhalevski/trie';
</script>

README

trie build

The compact trie data structure.

npm install --save-prod @smikhalevski/trie

Usage

⚠️ API documentation is available here.

import {TrieMap} from '@smikhalevski/trie';

const trieMap = new TrieMap();

trieMap.set('foo', 123);

trieMap.get('foo'); // → 123

trieMap.search('aaafoobbb', 3);
// → {key: 'foo', value: 123, …}

Performance

Clone this repo and use npm ci && npm run perf to run the performance testsuite.

Search performance

Search performance chart