pattern minor by @import:stackexchange-cs 112d ago
Which Tree traversal String is unique?
Assume we have a tree and we want to serialize it.
Example:
```
Tree
1
/ \
3 2
/ \ / \
5 N N N
/ \
N N
```
can result as:
```
"1,3,5,N,N,N,2,N,N", // Pre Order serialization;
"N,5,N,3,N,1,N,2,N", // In Order serialization;
"N,N,5,N,3,N,N,2,1", // Post Order serialization
```
I would like to know, which one of these three serializations is unique for all trees and why ?
csstackoverflowtreestree-traversalbinary-trees