Ternary Tree Multiple Choice Questions and Answers

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Ternary Tree”.

1. How many child nodes does each node of Ternary Tree contain?
a) 4
b) 6
c) 5
d) 3
View Answer

Answer: d
Explanation: Each node of Ternary tree contains at most 3 nodes. So Ternary tree can have 1, 2 or 3 child nodes but not more than that.

2. Which of the following is the name of the node having child nodes?
a) Brother
b) Sister
c) Mother
d) Parent
View Answer

Answer: d
Explanation: Parent node is the node having child nodes and child nodes may contain references to their parents. Parent node is a node connected by a directed edge to its child.

3. What is the depth of the root node of the ternary tree?
a) 2
b) 1
c) 0
d) 3
View Answer

Answer: c
Explanation: Depth is defined as the length of the path from root to the node. So the depth of root node in ternary tree is 0.
advertisement
advertisement

4. What is the Height of the root node of ternary tree?
a) 1
b) 2
c) 3
d) 0
View Answer

Answer: d
Explanation: Height of ternary tree is defined as the length of path from root to deepest node in tree. Therefore, height off root node in ternary tree is 0.

5. Which node is the root node of the following ternary tree?
Node A is the root node of the given following ternary tree
a) A
b) B
c) C
d) D
View Answer

Answer: a
Explanation: Node A is called the root node of the above ternary tree while the Node B, Node C, Node D are called Leaf node.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which node is the Leaf node in the following ternary tree?
Node G is the Leaf node in the following ternary tree
a) A
b) B
c) D
d) G
View Answer

Answer: d
Explanation: 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.

7. Which node is the parent node of Node 6?
Node 2 is the parent node of Node 6 in the given ternary tree
a) 1
b) 5
c) 2
d) 3
View Answer

Answer: c
Explanation: Since Node 2 has two children Node 5 and Node 6, So Node 2 is the parent node of Node 6. While Node 1 is root node and Node 3 and Node 5 are Leaf node.
advertisement

8. Is parent node of Node 3 and root node of the given ternary tree same?
Node 2 is the parent node of Node 6 in the given ternary tree
a) True
b) False
View Answer

Answer: a
Explanation: Since Root node of the ternary tree is Node 1 and also Node 1 has three children that is Node 2, Node 3, Node 4. So parent node of Node 3 and the root node of the ternary tree are same.

9. Which node is the child node of Node D in the following ternary tree?
Node G is the Leaf node in the following ternary tree
a) A
b) C
c) G
d) H
View Answer

Answer: d
Explanation: The Child node is the node that has a directed path from its parent node. Since Node D has a direct path to Node H, So Node H is the Child node.
advertisement

10. Which node is the child node of the Node D in the following ternary tree?
Node A is the root node of the given following ternary tree
a) A
b) C
c) B
d) No child node
View Answer

Answer: d
Explanation: Since Node D is the Leaf node of the above ternary tree and leaf node has no child node. So there is no child node for Node D in the above ternary tree.

11. What is the depth of Node G in the given ternary tree?
Node G is the Leaf node in the following ternary tree
a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: Depth of the node is the length of the path from root to the node. Here, length of path from root to Node G is 2. So depth of Node G is 2.

12. What is the Height of the given ternary tree?
The Height of the given ternary tree is 2 in the given ternary tree
a) 0
b) 1
c) 2
d) 3
View Answer

Answer: c
Explanation: Height of the tree is defined as the length of the path from root node to the deepest node of the tree. Here deepest nodes are 5,6,7 which are at length 2. So the height of the ternary tree is 2.

13. Which nodes are the siblings of Node B of given ternary tree?
Node G is the Leaf node in the following ternary tree
a) E
b) C
c) F
d) Both E and F
View Answer

Answer: d
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.

More MCQs on Ternary Tree:

Sanfoundry Global Education & Learning Series – Data Structure.

To practice all areas of Data Structure, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.