ISRO Computer Science (CSE) 2025 - Question 1

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2025

Topic: Data Structures

When a tree given in the diagram is traversed inorder, the order would be
[Diagram showing a binary tree with root 'a'.
Left child of 'a' is 'b'. Right child of 'a' is 'c'.
Left child of 'b' is 'd'. Right child of 'b' is 'e'.
Left child of 'd' is 'h'.
Left child of 'e' is 'i'. Right child of 'e' is 'j'.
Left child of 'c' is 'f'. Right child of 'c' is 'g'.
Left child of 'g' is 'k'.]

Figure for question 1, ISRO Computer Science (CSE) 2025

  • A. a, b, d, h, e, i, j, c, f, g, k
  • B. h, d, i, j, e, b, f, k, g, c, a
  • C. h, d, b, i, e, j, a, f, c, k, g
  • D. h, d, b, e, i, j, a, f, c, k, g

Answer: C. h, d, b, i, e, j, a, f, c, k, g

Explanation: Inorder traversal visits nodes in the order: Left Subtree, Root, Right Subtree.
Starting from root 'a':
1. Traverse left subtree of 'a' (rooted at 'b'):
- Traverse left subtree of 'b' (rooted at 'd'): left child 'h', then root 'd'. (h, d)
- Visit root 'b'.
- Traverse right subtree of 'b' (rooted at 'e'): left child 'i', then root 'e', then right child 'j'. (i, e, j)
Result for left subtree of 'a': h, d, b, i, e, j.
2. Visit root 'a'.
3. Traverse right subtree of 'a' (rooted at 'c'):
- Traverse left subtree of 'c': left child 'f'.
- Visit root 'c'.
- Traverse right subtree of 'c' (rooted at 'g'): left child 'k', then root 'g'. (k, g)
Result for right subtree of 'a': f, c, k, g.
Combining all parts: h, d, b, i, e, j, a, f, c, k, g.

| All questions of ISRO Computer Science (CSE) 2025