Search
⌘K
Get Premium
Leetcode 606. Construct String from Binary Tree
Given a binary tree root, produce a string from a preorder traversal where each node is its value followed by its children in parentheses; omit empty "()" pairs except you must include "()" for a missing left child when a right child exists to preserve structure. This is a tree traversal and string-construction problem that requires careful handling of parentheses to reflect absent children.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.