Which sequence represents the correct preorder traversal of a binary tree?

Options

  • A. Left, Right, Root
  • B. Root, Left, Right
  • C. Left, Root, Right
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. Root, Left, Right

Detailed Explanation

Preorder traversal visits the root before its subtrees. Its standard order is Root → Left → Right. It is commonly used when a tree needs to be copied or represented in a form where the root should be processed first. For comparison, inorder is Left → Root → Right, while postorder is Left → Right → Root. Memorizing these three patterns is essential for DSA examination questions.