For a binary tree the first node visited in in-order and post-order traversal is same.

Category: QuestionsFor a binary tree the first node visited in in-order and post-order traversal is same.
Editor">Editor Staff asked 5 months ago

For a binary tree the first node visited in in-order and post-order traversal is same.
 
(a) True
 
(b) False
 
My question is taken from Binary Trees topic in portion Binary Trees of Data Structures & Algorithms I
 
This question was addressed to me during an internship interview.

1 Answers
Editor">Editor Staff answered 5 months ago

The correct option is (b) False
 
The explanation is: Consider a binary tree,
 
Its in-order traversal – 13 14 16 19
 
Its post-order traversal- 14 13 19 16. Here the first node visited is not same.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40701