标签:
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
Thoughts
Go down through the left, when right is not null, push right to stack.
reference:
http://gongxuns.blogspot.com/2012/12/leetcode-flatten-binary-tree-to-linked.html
*[?]Flatten Binary Tree to Linked List
标签:
原文地址:http://www.cnblogs.com/hygeia/p/4774758.html