
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 { |
1 |
public void flatten(TreeNode root) { |

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 { |
1 |
public void flatten(TreeNode root) { |
近期评论