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.)
|
|