124 views

If the post order traversal of tree

gives $ab - cd * +$, then the label of the nodes A, B, C, ......, G will be

1. a, -, b, +, c, *, d
2. +, -, *, a, b, c, d
3. -, a, +, b, c, d, *
4. a, b, c, d, -, *, +
in Others
edited | 124 views
0

+1 vote

In post-order traversal , we've to

1. Traverse the left sub-tree of root
2. Traverse the right sub-tree of root
3. Visit the root

The nodes are visited in post-order as D  E  B  F  G  C  A

& according to the question D  E  B  F  G  C  A equals to ab - cd * +

∴ D = a , E = b , B = -  , F = c , G = d , C = * , A = +

write the things sequentially

A = + , B = -  , C = * , D = a , E = b , F = c , G = d

by Boss (15.1k points)
edited
+1 vote

So, The answer is option B)

by (185 points)

+1 vote
1
2