Which node is the Leaf node in the following ternary tree?

Category: QuestionsWhich node is the Leaf node in the following ternary tree?
Editor">Editor Staff asked 5 months ago

Which node is the Leaf node in the following ternary tree?

(a) A

(b) B

(c) D

(d) G

My enquiry is from 1 in portion Trees of Data Structures & Algorithms I

This question was addressed to me in an interview.

Editor">Editor Staff answered 5 months ago

The correct answer is (d) G

The best I can explain: Leaf node is any node that does not contain any children. Since Node G is the node without any children, So G is called Leaf Node. While Node A is root node and Node B, Node C, Node D is parent node of their children.

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: 40702