Serialize and Deserialize Binary Tree
Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work.
Serialize and Deserialize Binary Tree

Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work.

Example 1:
Input: {"root":[1,2,3,null,null,4,5]}
Output: [1,2,3,null,null,4,5]
Input
arr ={"root":[1,2,3,null,null,4,5]}

Created root 1

1

Variables
No variables to display
DepthFunction Call
Stack empty
0/11