Ternary Tree Multiple Choice Questions and Answers (MCQs) – 2

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

1. How many extra nodes are there in Full ternary tree than a complete ternary tree?
a) 1
b) 2
c) 3
d) Both have same number of nodes
View Answer

Answer: d
Explanation: Every Full ternary tree is also a complete ternary tree. Therefore, both have same number of nodes.

2. Is Node A sibling of Node D in the given ternary tree?
Node C are the siblings of Node D while Node A is the parent node of Node D
a) True
b) False
View Answer

Answer: b
Explanation: Node B, Node C are the siblings of Node D while Node A is the parent node of Node D.

3. What is the size of the given ternary tree?
The size of the given ternary tree is 6
a) 3
b) 2
c) 6
d) 4
View Answer

Answer: c
Explanation: Size of the ternary tree is defined as the total number of nodes present in the tree. Since there are total of 6 nodes in the ternary tree. So the size of the ternary tree is 6.
advertisement
advertisement

4. Who is the ancestor of Node G?
The ancestor of Node G is Node C comes between node G & root
a) C
b) F
c) H
d) A
View Answer

Answer: a
Explanation: Ancestor node is a node that comes in between the path from the node to the root. Since Node C comes between node G and root, so Node C is called the ancestor node.

5. Who is descendant of Node B?
Both node E & F is descendant of Node B which has direct path from ancestor node
a) A
b) E
c) F
d) Both E and F
View Answer

Answer: d
Explanation: Descendant node is a node which has a direct path from ancestor node. Since both E and F are connected to B, so Node E and Node F are the descendants of Node B.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. What is the size of Node A?
The size of Node A is 4 of descendants of that node including itself
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: d
Explanation: Size of node is defined as the total number of descendants of that node including itself. So, size of Node A is 4.

7. Can leaf node be called child node in a ternary tree?
a) True
b) False
View Answer

Answer: a
Explanation: Leaf node is a node that has no child. Since Leaf node will always be the node on the last level of ternary tree, so it can be called child node of given parent node in ternary tree.
advertisement

8. Can child node be always called Leaf node in the ternary tree?
a) True
b) False
View Answer

Answer: b
Explanation: Leaf node is any node that does not contain any children. Child node may or may not contain more nodes. Child node will only be called leaf Node if the node has no child node.

9. Which of the following is the implementation of the ternary tree?
a) AVL Tree
b) Ternary Heap
c) Hash Table
d) Dictionary
View Answer

Answer: b
Explanation: Ternary tree is used to implement ternary search tree and ternary heap. While AVL Tree, hash Table, dictionary are different types of Data Structures.
advertisement

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.