Serialize And Deserialize Binary Tree
easy
1. Serialization is to store tree in a file so that it can be later restored. 2. The structure of tree must be maintained. Deserialization is reading tree back from file.
Constraints
0 <= Number of Nodes <= 10^5 -1000 <= value of Node data <= 1000
Format
Input
Input is managed for you.
Output
Output is managed for you.
Example
Sample Input
15
1
1
-1
1
1
-1
1
-1
-1
1
-1
-1
1
-1
-1
Sample Output
1 -> 1
Question Video