in this question i relate pre-order and post order
https://gateoverflow.in/2504/gate1994-8
after reading it, you may answer to this question ( i know this question relating pre-order and in-order ).
If you still didn't get it after reading the answer, then comment !
by the way, option B is the answer !!
@ shaik
Why not option a is true .
@Shaik Masthan
why left and right both leaves are need t be grater than root in that GATE question?
I know some question need intution, but my logic saying, if they havenot mentioned any order, then the tree can be anything and there can be more than one tree , from which we can get that post order traversal
Isnot it?
I mean these two also can be valid tree
Am I wrong?
if these diagram correct, then I add these diagram in main question too
it is not BST. So, Preorder shouldnot always increasing order
moreover if it is even bst, we can't guarantee preorder is increasing sequence
yes, inorder sequence increasing order. I missed it.
but they havenot mentioned the term "respectively"
"respectively"
they defined pre order is 1 to 12 in the order respectively.
order respectively.
64.3k questions
77.9k answers
244k comments
80.0k users