← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure. You may use any traversal order (preorder, inorder, postorder, level-order) and any delimiter or marker you choose to represent null nodes. The goal is to convert the tree into a compact string representation and then reconstruct the exact same tree from that string.