data-structures-javascript icon indicating copy to clipboard operation
data-structures-javascript copied to clipboard

Best way to serialize the trie?

Open davey561 opened this issue 4 years ago • 0 comments

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?

davey561 avatar Jan 04 '21 19:01 davey561