Given a binary tree, flatten it to a linked list in-place.
For example, given the following tree:
1 | 1 |
The flattened tree should look like:
1 | 1 |
Code
1 | public class TreeNode { |
1 | public void flatten(TreeNode root) { |
写BUG的程序猿
Given a binary tree, flatten it to a linked list in-place.
For example, given the following tree:
1 | 1 |
The flattened tree should look like:
1 | 1 |
1 | public class TreeNode { |
1 | public void flatten(TreeNode root) { |