HardTrees
Serialize and Deserialize Binary Tree
Convert tree to/from string
Solution Approach
Pre-order traversal string
Complexity Analysis
Time Complexity
O(n)Space Complexity
O(n)Complexity
Time:O(n)
Space:O(n)
Asked at
GoogleAmazonMicrosoft
Convert tree to/from string
Pre-order traversal string
Time Complexity
O(n)Space Complexity
O(n)