Computer Science, asked by Alok6248, 10 months ago

The number of binary trees with 3 nodes which when traversed in post order gives the sequence a,b,c is ?" group of answer choices 3 9 7 5

Answers

Answered by shishankbiswal
0

Answer:

Lz mark my answer as brainliest

Explanation:

Now 3 being small number I was quick to draw all possible binary trees and come at the conclusion that there can be 5 such binary trees for given postorder.

C C C C C

/ \ / / \ \

A B B B B B

/ \ / \

A A A A

Then I tried to do the same for 4 nodes postorder traversal A,B,C,D. We will need D at the root. Then all A,B,C can be in the right subtree of left subtree. So there will be 2×5 such formations. Let us denote this as follows:

1root:3#nodes in left subtree:0#nodes in right subtree=5#tree arrangements

1:0:3=5

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

Answered by Deepak0211
3

Explanation:

Hope it w8lm hep you pkease and I 33333

Attachments:
Similar questions