data-structures-javascript
data-structures-javascript copied to clipboard
Best way to serialize the trie?
Hi,
I'm looking to serialize an instance of the prefix trie data structure so I can store it in a database. My current approach is to make a new js class that extends yours to allow construction by passing a value for the "root" field.
The one issue, though, is that the value for each word in the trie needs to be serialized and deserialized, too. I'm curious if you recommend any way to do this elegantly?