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
本文介绍了如何通过递归方法将二叉树扁平化为链表,详细解释了两种递归实现方式及其背后的逻辑。
831

被折叠的 条评论
为什么被折叠?



