Considering above binary tree, what will be the inorder traversal

2025

Considering above binary tree, what will be the inorder traversal

image.png

  1. A.

    B A D C E G F H

  2. B.

    G H F E D C B A

  3. C.

    B A C D E G F H

  4. D.

    G H F D E B C A

Attempted by 593 students.

Show answer & explanation

Correct answer: A

Inorder traversal follows the left-root-right order. Starting from the root A, we first visit the left subtree of A, which is B. Then we visit A. Next, we move to the left subtree of C, which is D. Then we visit C. After that, we visit the left subtree of E, which is empty, so we visit E. Then we move to the left subtree of F, which is G. Then we visit F. Finally, we visit the right subtree of F, which is H. The correct inorder traversal is B A D C E G F H.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Coding For Placement