s******d 发帖数: 61 | 1 in order traversal 然后一个一个list.add() 到linked list?
感觉太简单了,有什么问题吗? | V*******g 发帖数: 678 | 2 use preoder traversal. That can recover an exact copy of your tree later. | m**q 发帖数: 189 | 3 Preorder traversal result cannot uniquely identify the original tree
structure unless it is a BST, or you insert special node into the list
to represent NULL in the tree.
ihas1337code has a good example of how to make a double linked list
out of a binary tree, and is in-place.
【在 V*******g 的大作中提到】 : use preoder traversal. That can recover an exact copy of your tree later.
| s******d 发帖数: 61 | 4 看到了,可以插进去特别标示符,
可以用来deserialize |
|