Description:
From two arguments which are the sequence of preorder and postorder,
construct the corresponding process tree. The output should be in postorder.
a
/ | \
c b y
/ \
x t
For tree shown above, the output for your program may be like
as follows.
-----------------------------------------------------------------------
$ echo $$
14436 <------- pid of the shell
$
$ ./a.out acxtby xtcbya
Hello, I'm 14500, my parent is 14499, and my name is x
Hello, I'm 14501, my parent is 14499, and my name is t
Hello, I'm 14499, my parent is 14498, and my name is c
Hello, I'm 14502, my parent is 14498, and my name is b
Hello, I'm 14503, my parent is 14498, and my name is y
Hello, I'm 14498, my parent is 14436, and my name is a
$