
Which one of the following is the correct match from T to S?
Correct : a
To find the correct match, we need to recall the standard definitions of the three primary depth-first binary tree traversals: Inorder, Preorder, and Postorder.
I: Inorder Traversal (Matches L)
In an inorder traversal, the algorithm recursively visits the left subtree, then processes the root node, and finally recursively visits the right subtree. Therefore, I correctly matches L (left subtree, node, right subtree).
II: Preorder Traversal (Matches M)
In a preorder traversal, the algorithm processes the root node first, before moving on to recursively visit the left subtree, and finally the right subtree. Therefore, II correctly matches M (node, left subtree, right subtree).
III: Postorder Traversal (Matches N)
In a postorder traversal, the algorithm recursively visits the left subtree, then recursively visits the right subtree, and processes the root node at the very end. Therefore, III correctly matches N (left subtree, right subtree, node).
Correct Match: I-L, II-M, III-N β
Similar Questions
Total Unique Visitors