Computer Science, asked by Firerage2694, 1 year ago

How many 3 node binary trees are possible if the postorder traversal is xyz?

Answers

Answered by aqibkincsem
25

For this specified post order I could figure out that there can be 5 binary trees possibly.

X yzzz / \      /      /       \       \. xyyyyy       /        \       /         \. Xxxx.

Now there is another possibility that 2 nodes are in the left subtree and the 3rd one in the right subtree or vice versa.

Then,1:2:1=2..1:1:2=2. Total =14, Hence this is the answer.

Similar questions