https://leetcode.cn/problems/flatten-binary-tree-to-linked-list/ 题目中要求把链表展开为单链表,并且展开后的链表要跟二叉树的前序遍历顺序相同。 /*** Definition for a binary tree node.* struct TreeNode {* int val;* stru
Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1/ \2 5/ \ \3 4 6 The flattened tree should look like: 1\2\3\4\5\6 题目链接:https://lee