← All problems
Serialize and Deserialize Binary Tree
Design an algorithm to serialize a binary tree to a string and back.
Complexity
Time O(n), Space O(n)
Common pitfalls
- Ambiguous encoding without null markers
- Shared mutable index bugs
Your solution
Log in to save your code and track progress.