IAE Academy

ISRO CS 2025 Q.1: solution and answer

ISRO 2025 · CSQ.1 · 1 mark · MCQ

When a tree given in the diagram is traversed inorder, the order would be

ISRO CS 2025 question 1: Binary tree.Tap to open full size
Figure from the ISRO CS 2025 paper. It is part of the question.
Figure description

Binary tree. Root a has left child b and right child c. b has left child d and right child e. d has only a left child h. e has left child i and right child j. c has left child f and right child g. g has only a left child k. f, h, i, j and k are leaves.

  1. (A)

    a, b, d, h, e, i, j, c, f, g, k

  2. (B)

    h, d, i, j, e, b, f, k, g, c, a

  3. (C)

    h, d, b, i, e, j, a, f, c, k, g

  4. (D)

    h, d, b, e, i, j, a, f, c, k, g

Answer and solution

ANSWER

The inorder sequence is , which is option (c).

Official answer: CSource: ISRO's final answer key of 15 May 2026

  1. Inorder traversal visits the left subtree, then the node itself, then the right subtree, applied recursively at every node.

  2. Structure from the diagram: has left child and right child . has left child and right child . has only a left child . has left child and right child . has left child and right child . has only a left child .

  3. Left subtree of (rooted at ): its left subtree is rooted at . 's left subtree is just , so the order is , then (no right child). After that comes itself.

  4. Right subtree of (rooted at ): visit , then , then . So the whole left subtree of gives .

  5. Then visit the root .

  6. Right subtree of (rooted at ): visit (left), then , then the subtree of . In that subtree is the left child, so comes before . This gives .

  7. Joining the three parts: , which is option (c).

  8. Option (a) starts at the root, so it is a preorder-type order. Option (b) ends with the root , so it is a postorder-type order. Option (d) visits before and , but in an inorder traversal must come between its left child and its right child .

KEY IDEA

Inorder means left subtree, node, right subtree, applied recursively. A node with only a left child is visited right after that child's subtree.

WATCH OUT FOR

Writing a node before its left subtree (preorder) or after its right subtree (postorder). Another slip is visiting a node with two children, such as , before its left child.

From the ISRO CS 2025 paper. Every question of this paper · The full paper (PDF, ISRO) · All 3 ISRO Trees & heaps questions, with notes

More ISRO Trees & heaps questions