Flatten Binary Tree to Linked List

来源:互联网 发布:洛阳软件培训班 编辑:程序博客网 时间:2024/06/06 18:46

Given a binary tree, flatten it to a linked list in-place.
For example, Given
   1
  /   \
 2     5
/  \     \
3   4     6
The flattened tree should look like:
1
 \
 2
  \
   3
    \
     4
      \
       5
        \
         6
题意:
这是树的题目,要求把一颗二叉树按照先序遍历顺序展成一个链表。
http://www.cfanz.cn/index.php?c=article&a=read&id=142361

0 0
原创粉丝点击