I hereby claim:
- I am benjamine on github.
- I am beneidel (https://keybase.io/beneidel) on keybase.
- I have a public key ASC4nFm8k2A6h7skCx7s_w2yfOWFrM_vwIPnJrGYSYk-5Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env node | |
| /* | |
| Requirements: | |
| - node v8.9.3+ | |
| - npm install mongodb | |
| - npm install p-queue | |
| */ | |
| const PQueue = require('p-queue'); | |
| const mongodb = require('mongodb'); |
| function Trie() { | |
| this.head = { | |
| key : '' | |
| , children: {} | |
| } | |
| } | |
| Trie.prototype.add = function(key) { | |
| var curNode = this.head |
| class Trie { | |
| head = { | |
| key: "", | |
| children: {} | |
| }; | |
| add(key) { | |
| var curNode = this.head, | |
| newNode = null, | |
| curChar = key.slice(0, 1); |