D-ary Heap Multiple Choice Questions and Answers (MCQs)

«
»

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “D-ary Heap”.

1. d-heap is similar to that of a?
a) binary heap
b) fibonacci heap
c) leftist heap
d) treap
View Answer

Answer: a
Explanation: A d-heap is similar to that of a binary heap except that binary heaps have two children and d-heaps have d children.
advertisement

2. d-heap is shallower than a binary heap.
a) true
b) false
View Answer

Answer: a
Explanation: d-heap is much shallower than a binary heap with respect to performance efficiency of insert and delete operations.

3. Which operation cannot be directly performed in a d-heap?
a) insert
b) delete
c) find
d) create
View Answer

Answer: c
Explanation: Find operation in a d-heap cannot be performed as in other heaps. This is the main weakness of d-heap.
Note: Join free Sanfoundry classes at Telegram or Youtube
advertisement
advertisement

4. Which operation is not efficiently performed in a d-heap?
a) insert
b) delete
c) find
d) merge
View Answer

Answer: d
Explanation: Unlike find operation, which cannot be performed in a d-heap, the task of merging two d-heaps is very difficult.

5. What is the run time efficiency of an insertion algorithm in d-heap?
a) O(N)
b) O(log N)
c) O(logd N)
d) O(Nd)
View Answer

Answer: c
Explanation: The run time efficiency of an insertion algorithm in a d-heap is found to be O(logd N) where d is the number of children.
Take Data Structure I Practice Tests - Chapterwise!
Start the Test Now: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
advertisement

6. How many comparisons will occur while performing a delete-min operation?
a) d
b) d-1
c) d+1
d) 1
View Answer

Answer: b
Explanation: Since, the delete-min operation is more expensive and the heap is shallow, the minimum of d elements can be found using d-1 comparisons.

7. How many basic operations can be performed in a d-heap?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation: The two basic operations performed in a d-heap are insert and delete-min operations.
advertisement

8. What is the run time efficiency of delete-min operation?
a) O(log N)
b) O(logd N)
c) O(d logd N)
d) O(d)
View Answer

Answer: c
Explanation: The run time efficiency of a delete-min algorithm using d-1 comparisons is mathematically found to be O(d logd N).

9. The following figure is an example for
The given heap is a d-heap since it looks like a binary heap with d-children
a) d-heap
b) binary heap
c) leftist heap
d) skew heap
View Answer

Answer: a
Explanation: The given heap is a d-heap since it looks like a binary heap with d- children. Here, d=3.
advertisement

10. Multiplication and division to find children and parents cannot be implemented in a d-heap.
a) true
b) false
View Answer

Answer: b
Explanation: Multiplication and division for finding children and parents can be implemented in a d-heap but d should be a power of 2.

11. How many secondary operations are performed in a d-heap?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: d
Explanation: The other operations that can be performed in a d-heap are increasekey, decreasekey, buildheap and delete.

12. On which data structure is a d-ary heap based?
a) stack
b) queue
c) linked list
d) priority queue
View Answer

Answer: d
Explanation: d-ary heap is a priority queue based data structure that is a generalization of binary heaps.

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.

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 & technical discussions at Telegram SanfoundryClasses.