Cruise
Closed this issue · 1 comments
darrenfu commented
12/10/2019
297. Serialize and Deserialize Binary Tree
Follow-up:
- What if we cannot use delimiter like comma or space.
- 428. Serialize and Deserialize N-ary Tree - interviewer just mentioned it, not test it.
darrenfu commented
I use preorder traverse.
For follow-up, I mentioned about convert the string array into a binary payload, and store the offset for each node value in the header meta. E.g.
[header: totalLength,[offset0,offset1,offset2,...]][payload: ]