I would like to convert a dictionary of words into a binary file. after some search time, I found out that ternary search tree is the best option for my usage. I couldn't find how to serialize it to a file. Each node will have a char value, 3 pointers (for three children - low,equal,high) and another field (for saving other information) How can I serialize it? Thanks
Asked
Active
Viewed 203 times
0
-
recursively and with lots of love. Seriously, where are you stuck? And why can't you just put a list of strings into a file? – Thomas Jungblut Mar 02 '14 at 12:15
-
@ThomasJungblut I need to use as less space as I can get, so I would like to serialize the tree into binary and then deserialize it – leah Mar 02 '14 at 12:20
-
Traditional answer would be to have the tree, and every object in it, implement `Serializable`. Then just write it out with an ObjectOutputStream. That simplifies the problem to one object at a time. – keshlam Mar 02 '14 at 16:28