All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · September 2022

Consider the traversals of a tree:
Preorder → ABCEIFJDGHKL
Inorder → EICFJBGDKHLA
Which of the following is the correct postorder traversal?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. IEJFCGKLHDBA

Explanation

A is the root with only a left subtree rooted at B. B's left subtree is C (left E with right child I, right F with right child J). B's right subtree is D (left G, right H with children K, L). Postorder: I E J F C G K L H D B A.

More Data Structures and Algorithms questions