114. Flatten Binary Tree to Linked List
题目描述
Given a binary tree, flatten it to a linked list in-place.
|
|
click to show hints.
Hints:
If you notice carefully in the flattened tree, each node’s right child points to the next node of a pre-order traversal.
题目大意
变二叉树为链表
解题思路
按照右-左-根的顺序遍历二叉树
代码
|
|