606. Construct String from Binary Tree
https://leetcode.com/problems/construct-string-from-binary-tree/
二叉树表示成由()和数字组成的字符串,数字代表二叉树结点的值,数字旁边分别是左右子树,每个子树是括号括起来的递归定义的树,如果只有右子树则需要引入一个空()。根据题目规定做pre-order 遍历,返回的str外加()。
Last updated
Was this helpful?
https://leetcode.com/problems/construct-string-from-binary-tree/
二叉树表示成由()和数字组成的字符串,数字代表二叉树结点的值,数字旁边分别是左右子树,每个子树是括号括起来的递归定义的树,如果只有右子树则需要引入一个空()。根据题目规定做pre-order 遍历,返回的str外加()。
Last updated
Was this helpful?