Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
juki
on Nov 4, 2021
|
parent
|
context
|
favorite
| on:
Trie in JavaScript: The data structure behind auto...
No, it mutates the input trie. If you call `insert(trie, "foo")` with an empty trie, it will be modified to look like
{'f': {'o': {'o': {END: True}}}}
I don't think this implementation is efficient enough to ever be worth using in a real program, though.
masklinn
on Nov 4, 2021
[–]
It probably works well enough for relatively simple problems, but the overhead of the dicts is definitely going to kill you memory-wise.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: