Which of the following best describes the correct sequence of node visits in a…
2025
Which of the following best describes the correct sequence of node visits in a preorder traversal of a tree?
- A.
Visit root → Visit left subtree → Visit right subtree
- B.
Visit left subtree → Visit right subtree → Visit root
- C.
Visit right subtree → Visit root → Visit left subtree
- D.
Visit left subtree → Visit root → Visit right subtree
Attempted by 112 students.
Show answer & explanation
Correct answer: A
Preorder traversal visits nodes in the order: root first, then recursively traverse the left subtree, and finally traverse the right subtree. This sequence ensures that each node is processed before its children.