MCQ Single Best Answer Moderate

Q
[Data Structure]

For the given Binary Tree, which traversal order will arrange the elements in ascending order?
Binary Tree Structure:

                 4
               /   \
              2     7
                   / \
                  5   8
                       \
                        9

        

ID: #24952 Competency focused Practice Questions ISC Class XII Computer Science 3 views
Question Info
#24952Q ID
ModerateDifficulty
Competency focused Practice Questions ISC Class XII Computer ScienceTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Post order
  • B Pre order
  • C In order
  • D Postfix order
Correct Answer: Option C

Explanation

[Data Structure]

For the given Binary Tree, which traversal order will arrange the elements in ascending order?
Binary Tree Structure:

                 4
               /   \
              2     7
                   / \
                  5   8
                       \
                        9

        
(a) Post order
(b) Pre order
(c) In order
(d) Postfix order
Correct Answer: (c) In order

Understanding Binary Tree Traversal:

Tree traversal means visiting all nodes of a tree in a specific order.

Main Types of Traversal:

Traversal Type Order
Preorder Root → Left → Right
Inorder Left → Root → Right
Postorder Left → Right → Root

Important Concept:

In a Binary Search Tree (BST), Inorder Traversal always produces elements in ascending order.

Applying Inorder Traversal:

Left → Root → Right

Step-by-Step Traversal:

  • Visit left subtree of 4 → 2
  • Visit root → 4
  • Visit left subtree of 7 → 5
  • Visit root → 7
  • Visit right subtree → 8 → 9

Final Inorder Sequence:

2 → 4 → 5 → 7 → 8 → 9

This sequence is in ascending order.

Why Other Options are Incorrect?

Traversal Result Ascending?
Preorder 4 → 2 → 7 → 5 → 8 → 9 No
Postorder 2 → 5 → 9 → 8 → 7 → 4 No
Postfix order Not a standard tree traversal term No

Conclusion:

Since Inorder Traversal arranges BST elements in ascending order, the correct answer is:

(c) In order

Share This Question

Challenge a friend or share with your study group.