in order traversal 然后一个一个list.add() 到linked list? 感觉太简单了,有什么问题吗?
V*g
2 楼
use preoder traversal. That can recover an exact copy of your tree later.
m*q
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.