1) save the nodes(value, left and right pointer) in pre-order traversal
2) also save pointers of all node in same order

to restore
1) create new N nodes
2) do pointer mapping from old -> new
3) restore nodes and replace old pointers to new


On Fri, Nov 8, 2013 at 8:50 PM, Don <[email protected]> wrote:

> Save it in pre-order.
> Rebuild by inserting nodes in the order they occur in the file.
>
>
> On Friday, November 8, 2013 8:33:19 AM UTC-5, kumar raja wrote:
>>
>> What is the effective way to save and restore the binary trees to files
>> effectively?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Regards,
>> Kumar Raja.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
>



-- 
Thanks,
Vishnu

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to