Redian新闻
>
问道Binary tree serialization/de-serialization的题
avatar
b*5
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的,但好像不是面试官想要的答案。。

avatar
s*x
3
Pay attention for the space, which can be used to distinguish different
strings.
avatar
w*k
4
0

【在 s********x 的大作中提到】
: Pay attention for the space, which can be used to distinguish different
: strings.

avatar
z*b
5
说了空格,可是面试官说node 的 value string里可能含有空格啊。

【在 s********x 的大作中提到】
: Pay attention for the space, which can be used to distinguish different
: strings.

avatar
l*i
6
turn each space in the original value string into \space
turn each \ into double \
then you can use space as the deliminator
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。