z***b 发帖数: 127 | 1 http://leetcode.com/2010/09/serializationdeserialization-of-bin
leetcode 上这个答案是针对树节点的value是整数的,如果value可以是任意string,该
怎么做serialize/deserialize好呢?
说了那个preorder/inorder的,但好像不是面试官想要的答案。。 |
b**********5 发帖数: 7881 | 2 it's probably not because preorder/inorder, it's about how u deliminate the
string...
【在 z***b 的大作中提到】 : http://leetcode.com/2010/09/serializationdeserialization-of-bin : leetcode 上这个答案是针对树节点的value是整数的,如果value可以是任意string,该 : 怎么做serialize/deserialize好呢? : 说了那个preorder/inorder的,但好像不是面试官想要的答案。。
|
s********x 发帖数: 81 | 3 Pay attention for the space, which can be used to distinguish different
strings. |
w****k 发帖数: 755 | 4 0
【在 s********x 的大作中提到】 : Pay attention for the space, which can be used to distinguish different : strings.
|
z***b 发帖数: 127 | 5 说了空格,可是面试官说node 的 value string里可能含有空格啊。
【在 s********x 的大作中提到】 : Pay attention for the space, which can be used to distinguish different : strings.
|
l*******i 发帖数: 57 | 6 turn each space in the original value string into \space
turn each \ into double \
then you can use space as the deliminator |