Pre-order Traversal category - Data Structure

Q.  Which among the following belongs to the category of a Pre-order Traversal?
- Published on 25 Aug 15

a. Root -> Left Sub Tree -> Right Sub Tree
b. Root -> Right Sub Tree -> Left Sub Tree
c. Right Sub Tree -> Left Sub Tree -> Root
d. Left Sub Tree -> Right Sub Tree -> Root

ANSWER: Root -> Left Sub Tree -> Right Sub Tree
 

    Discussion

  • Nirja Shah   -Posted on 21 Nov 15
    Preorder Traversal:
    - Visit the root.
    - Traverse the left subtree.
    - Traverse the right subtree.
    Root → Left Sub Tree → Right Sub Tree
    Example:


Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)