Question

    Which of the following represents the Preorder

    Traversal of the binary tree given below?         A        / \       B    C      / \     D    E
    A D, B, E, A, C Correct Answer Incorrect Answer
    B A, B, D, E, C Correct Answer Incorrect Answer
    C D, E, B, C, A Correct Answer Incorrect Answer
    D B, D, E, A, C Correct Answer Incorrect Answer
    E A, C, B, E, D Correct Answer Incorrect Answer

    Solution

    Preorder traversal follows the sequence: Root → Left Subtree → Right Subtree . Let's analyze the traversal step by step:

    1. Start at the root node A . Visit A first.
    2. Move to the left child B . Visit B .
    3. Traverse the left subtree of B , visiting D .
    4. Traverse the right subtree of B , visiting E .
    5. Finally, move to the right child of A , which is C .
    The resulting sequence is: A, B, D, E, C . Why Other Options Are Incorrect: ·         Option A (D, B, E, A, C): This sequence follows an Inorder Traversal (Left → Root → Right) rather than Preorder. While correct for Inorder, it does not meet the criteria of Preorder traversal. ·         Option C (D, E, B, C, A): This sequence represents Postorder Traversal (Left → Right → Root). Nodes are visited in the order of their subtrees before the root, which does not match the Preorder definition. ·         Option D (B, D, E, A, C): Although this includes the left subtree before the right subtree, it skips the root node A as the first element, violating the Preorder rule where the root must come first. ·         Option E (A, C, B, E, D): Here, the sequence traverses the right subtree C before completing the left subtree B , which is against the Preorder principle of processing the left subtree before the right.

    Practice Next