由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Discuss: best way to serialize binary tree? (without the special character)
相关主题
怎样serialize binary tree 比较好?求教一道老题
Deserialize in-order array to a minimum height binary tree.这个Binary Tree的题来看看
F家phone interview的一道题聊聊黑名单吧
如何 serialization 和deserialization hash table ?讨论个Binary search tree的题目
攒人品, Amazon电面bloomberg电面
Google第二次电面我也来报个amazon phone interview的面经吧
啥叫encode/decode binary tree啊?关于trie和binary search tree的疑问。
问道Binary tree serialization/de-serialization的题amazon 电面面经
相关话题的讨论汇总
话题: character话题: special话题: binary话题: tree话题: without
进入JobHunting版参与讨论
1 (共1页)
l********r
发帖数: 140
1
All the solutions I can find will need to use the special character to
represent the empty node. Is there a way to do it without using it?
For example:
a
b c
Will need 4 special character to represent the 4 null children nodes, which
will take too much space. Is there a way to save / load this binary tree
without using the special character?
(note: we are talking about a regular binary tree. It may not be balanced,
it is not a BST.)
s*****l
发帖数: 10
2
如果Binary Tree中有N个节点,那么只需要保存N+1个特殊字符,还是O(N)的空间复杂
度,不算too much吧。
c********t
发帖数: 5706
3
without using the special character, how can you make serialized string
unique?

which

【在 l********r 的大作中提到】
: All the solutions I can find will need to use the special character to
: represent the empty node. Is there a way to do it without using it?
: For example:
: a
: b c
: Will need 4 special character to represent the 4 null children nodes, which
: will take too much space. Is there a way to save / load this binary tree
: without using the special character?
: (note: we are talking about a regular binary tree. It may not be balanced,
: it is not a BST.)

1 (共1页)
进入JobHunting版参与讨论
相关主题
amazon 电面面经攒人品, Amazon电面
Amazon Interview: algorithm for 2*LOG(N) up bound for searchGoogle第二次电面
这个check whether a binary tree is a BST 问题啥叫encode/decode binary tree啊?
谁有较好的iterative后序遍历binary tree的代码?问道Binary tree serialization/de-serialization的题
怎样serialize binary tree 比较好?求教一道老题
Deserialize in-order array to a minimum height binary tree.这个Binary Tree的题来看看
F家phone interview的一道题聊聊黑名单吧
如何 serialization 和deserialization hash table ?讨论个Binary search tree的题目
相关话题的讨论汇总
话题: character话题: special话题: binary话题: tree话题: without