Multiple choice technology architecture

The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal

  1. ABFCDE

  2. ADBFEC

  3. ABDECF

  4. ABDCEF

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Given post-order DEBFCA of a binary tree, the root is A (last visited). From preorder ABDECF, A's left subtree is B-D-E and right is F-C. Post-order shows left subtree post-order is D-E-B, meaning B is root of left subtree with D and E as children. This uniquely determines the structure yielding preorder ABDECF.