Question discussion

The preorder traversal of a binary tree is A B D E C F and its inorder traversal is D B E A F C. What is its postorder traversal?

1503Medium DSSSB TGT Computer Science 0 replies 1 views
0

The preorder traversal of a binary tree is A B D E C F and its inorder traversal is D B E A F C. What is its postorder traversal?

  • AD E B F C A
  • BD B E F C A
  • CD E F B C A
  • DE D B F C A
Correct answer: A

Explanation

A is the root; B (with children D and E) forms the left subtree and C (with left child F) the right subtree, so the postorder is D E B F C A.

Discussion 0

Nobody has replied yet. Start the discussion!