Which nodes are the siblings of Node B of given ternary tree?

Category: QuestionsWhich nodes are the siblings of Node B of given ternary tree?
Editor">Editor Staff asked 4 weeks ago

Which nodes are the siblings of Node B of given ternary tree?
 
(a) E
 
(b) C
 
(c) F
 
(d) Both E and F
 
My enquiry is from Ternary tree topic in section Trees of Data Structures & Algorithms I
 
This question was addressed to me in an online interview.

1 Answers
Editor">Editor Staff answered 4 weeks ago

The correct answer is (d) Both E and F
 
Easiest explanation – Siblings are the nodes that share same parent. Since both the Node E and Node F have same parent Node B, So the sibling of Node B is Node E and Node F.