Ternary Heap Multiple Choice Questions and Answers (MCQs) – 1

«
»

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

1. What is the smallest element of the given minimum ternary heap?
ternary-heap-multiple-choice-questions-and-answers-mcqs-q1
a) 1
b) 10
c) 18
d) 20
View Answer

Answer: a
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. Minimum ternary heap has the smallest element as its root node. The parent node is all either equal or less than children node in a minimum ternary heap.
advertisement

2. What is the highest element of the given maximum ternary heap?
ternary-heap-multiple-choice-questions-and-answers-mcqs-q2
a) 31
b) 10
c) 18
d) 20
View Answer

Answer: a
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. Maximum ternary heap has the highest element as its root node. The parent node is all either equal or greater than children node in a maximum ternary heap.

3. What is the child of smallest element of the given minimum ternary heap?
ternary-heap-multiple-choice-questions-and-answers-mcqs-q1
a) 1
b) 10
c) 22
d) 24
View Answer

Answer: b
Explanation: Minimum ternary heap has the smallest element as its root node. The parent node is all either equal or less than children node in a minimum ternary heap. In the above minimum ternary heap, the smallest element is 1 and its children are 10, 18, 20.
advertisement
advertisement

4. What are the siblings of smallest element of the given maximum ternary heap?
ternary-heap-multiple-choice-questions-and-answers-mcqs-q2
a) 31
b) 12
c) 18
d) 22
View Answer

Answer: c
Explanation: Maximum ternary heap has the highest element as its root node. The parent node is all either equal or greater than children node in a maximum ternary heap. The smallest element in the maximum ternary heap is 10 and its siblings are 18, 20.

5. What is the height of a given minimum ternary heap?
ternary-heap-multiple-choice-questions-and-answers-mcqs-q1
a) 1
b) 10
c) 2
d) 24
View Answer

Answer: a
Explanation: Minimum ternary heap has the smallest element as its root node. The parent node is all either equal or less than children node in a minimum ternary heap. Height is the total length from the root node to the leaf node. So the height of the minimum ternary heap is 1.
advertisement

6. What is the ancestor of the leaf node in a given minimum ternary heap?
ternary-heap-multiple-choice-questions-and-answers-mcqs-q1
a) 1
b) 10
c) 18
d) 20
View Answer

Answer: a
Explanation: Minimum ternary heap has the smallest element as its root node. The parent node is all either equal or less than children node in a minimum ternary heap. Ancestor is the node falling on the path from that node to the root node. So here ancestor of all leaf nodes is 1.

7. Which property should ternary heap hold for execution?
a) Associative
b) Commutative
c) Tree
d) Heap
View Answer

Answer: d
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. So, it should hold all the properties of Heap that is all the levels of the heap has to be filled from left to right.
advertisement

8. Should leaves in ternary heap be distributed from left to right.
a) True
b) False
View Answer

Answer: a
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. So, it should hold all the properties of Heap that is all the levels of the heap has to be filled from left to right.

9. What is the process of building a ternary heap called?
a) Heapify
b) Hashing
c) Linking
d) Merging
View Answer

Answer: a
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. So, the process of building a ternary heap is known as Heapify.
advertisement

10. Which type of data structure is a ternary heap?
a) Array
b) Hash
c) Priority Queue
d) Priority Stack
View Answer

Answer: c
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. It is a priority queue type of data structure that follows all the property of heap.

11. Is the priority queue abstract data type.
a) True
b) False
View Answer

Answer: a
Explanation: Priority queue is an abstract data type. It is also the extension of the Queue data structure where all the elements have been assigned some priority and on the basis of this priority, the elements are dequeued from the structure.

12. What is a ternary heap?
a) An array with three elements
b) Linked list with three elements
c) Tree with three children
d) Heap with all nodes having three children
View Answer

Answer: d
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. So, it follows all the property of heap. Therefore, all the nodes in the ternary heap have 3 nodes.

13. Who invented d-ary heap?
a) Carl Rick
b) Alan Turing
c) Donald Johnson
d) Euclid
View Answer

Answer: c
Explanation: Ternary heap is a type of data structure in the field of computer science. It is a part of the Heap data structure family. The d-ary heap was invented by Donald Johnson in the year 1975.

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.

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!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter