a binary tree has 10 nodes. The inorder and preorder traversal of the tree are shown below

Preorder: JCBADEFIGH
inorder: ABCEDFJGIH

Please draw the tree

這好像是二元搜尋樹的畫法,有大大'能教一下嗎??
然後還有一題是:
Show the contents of stack S1 and the value of variables x and y after the following algorithm segment is excited.

STACK(S1)
push(S1,5)
push(S1,3)
push(S1,2)
if(not empty(S1)) pop (S1,x)
if(not empty(S1)) pop (S1,y)
push(S1,6)