Which of the following ways is a in-order traversal?

Options
- Root->left sub tree-> right sub tree
- Root->right sub tree-> left sub tree
- right sub tree-> left sub tree->Root
- left sub tree-> root->right sub tree


CORRECT ANSWER : left sub tree-> root->right sub tree

Discussion Board
Data Structure - Inorder Traversal

In case of binary search trees (BST), Inorder traversal gives nodes in non-decreasing order. Algorithm for inorder traversal is:
Step 1: Start from the Left Subtree.
Step 2: Then, visit the Root.
Step 3: Then, go to the Right Subtree.

So, the above answer is correct. Inorder Traversal: Left subtree -> Root -> Right subtree

Prajakta Pandit 01-31-2017 06:10 AM

Write your comments


Enter the code shown above:

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


Advertisement