The inorder traversal of the following tree is:
(A) 2 3 4 6 7 13 15 17 18 18 20
(B) 20 18 18 17 15 13 7 6 4 3 2
(C) 15 13 20 4 7 17 18 2 3 6 18
(D) 2 4 3 13 7 6 15 17 20 18 18
Answer: (D)
Explanation: In inorder traversal first we traverse left node then root node and then right node:
In the following tree
we first go to the leftmost node then its root after that right i.e. 2 4 3 13 7 6 15 17 20 18 18. In rest of the option inorder property is violating.
So, option (D) is correct.
Quiz of this Question