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 4 weeks 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.

1 Answers
Editor">Editor Staff answered 4 weeks 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.