What is the correct preorder traversal for this binary tree? A / \ B C / \ D E

2025

What is the correct preorder traversal for this binary tree?

A
/ \
B C
/ \
D E

  1. A.

    DEBCA

  2. B.

    ABDEC

  3. C.

    DBEAC

  4. D.

    ADBEC

Attempted by 102 students.

Show answer & explanation

Correct answer: B

Preorder traversal visits root, left subtree, then right subtree. For tree A(B(D,E),C), the sequence is A→B→D→E→C, matching option 1's answer ABDEC.

Explore the full course: Niacl Ao It Specialist