edited by
5,375 views
20 votes
20 votes

If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______

edited by

5 Answers

Best answer
29 votes
29 votes

During the in-order traversal algorithm, the left subtree is explored first, followed by root, and finally nodes on the right subtree.

In order traversal is $:4 \ 1 \ 6 \ 7 \ 3 \ 2 \ 5 \ 8.$

edited by
12 votes
12 votes
Two ans possible as the fig is little ambiguous

Case 1:- if 5 is LHS of 3

Inorder:--4 1 6 7 2 5 8 3

Case 2:- if 5 is RHS of 3

inorder :- 4 1 6 7  3 2 5 8

Related questions

25 votes
25 votes
3 answers
1
Kathleen asked Sep 12, 2014
4,251 views
Consider the binary tree in the figure below:What structure is represented by the binary tree?
31 votes
31 votes
2 answers
2
Akash Kanase asked Apr 18, 2016
2,950 views
Consider the binary tree in the figure below:Outline a procedure in Pseudo-code to delete an arbitrary node from such a binary tree with $n$ nodes that preserves the stru...
20 votes
20 votes
3 answers
3
Akash Kanase asked Apr 18, 2016
3,454 views
Consider the binary tree in the figure below:Give different steps for deleting the node with key $5$ so that the structure is preserved.
44 votes
44 votes
2 answers
4
Kathleen asked Sep 12, 2014
13,566 views
The weighted external path length of the binary tree in figure is ______