Question: In a binary tree, what is the in-order traversal of the nodes?
Options:
Visit left subtree, root, right subtree
Visit root, left subtree, right subtree
Visit left subtree, right subtree, root
Visit right subtree, root, left subtree
Correct Answer: Visit left subtree, root, right subtree
Solution:
In in-order traversal, the nodes are visited in the order: left subtree, root, right subtree.
In a binary tree, what is the in-order traversal of the nodes?
Practice Questions
Q1
In a binary tree, what is the in-order traversal of the nodes?
Visit left subtree, root, right subtree
Visit root, left subtree, right subtree
Visit left subtree, right subtree, root
Visit right subtree, root, left subtree
Questions & Step-by-Step Solutions
In a binary tree, what is the in-order traversal of the nodes?
Step 1: Start at the root node of the binary tree.
Step 2: Move to the left child of the root node.
Step 3: If the left child has its own left child, move to that left child.
Step 4: Repeat Step 3 until you reach a node that has no left child.
Step 5: Visit (or record) the current node (this is the leftmost node).
Step 6: Move back to the parent node of the leftmost node.
Step 7: Visit (or record) the parent node.
Step 8: Move to the right child of the parent node (if it exists).
Step 9: Repeat Steps 3 to 8 for the right subtree.
Step 10: Once the right subtree is fully traversed, move back up to the previous nodes and repeat the process until all nodes are visited.
In-Order Traversal – A method of visiting nodes in a binary tree where the left subtree is visited first, followed by the root node, and then the right subtree.
Soulshift Feedback×
On a scale of 0–10, how likely are you to recommend
The Soulshift Academy?