Podcast
Questions and Answers
What is a characteristic of a K-ary heap?
What is a characteristic of a K-ary heap?
- It does not support deletion operation
- It guarantees constant time for all operations
- It is a complete binary tree (correct)
- It is always an unbalanced tree
In a K-ary heap, what is the index of the parent node of a node at index i?
In a K-ary heap, what is the index of the parent node of a node at index i?
- ki-1
- (ki)+1
- (i-1)/k (correct)
- i/k
What is the index of the last non-leaf node in a K-ary heap with n nodes?
What is the index of the last non-leaf node in a K-ary heap with n nodes?
- (n-2)/k (correct)
- (n-1)/k
- n/k
- (n+1)/k
How many comparisons are needed in the worst-case scenario for finding the maximum element in a K-ary heap?
How many comparisons are needed in the worst-case scenario for finding the maximum element in a K-ary heap?
What is a disadvantage of using a large value of K in a K-ary heap?
What is a disadvantage of using a large value of K in a K-ary heap?
In a K-ary heap, what is the index of a child node of a node at index i?
In a K-ary heap, what is the index of a child node of a node at index i?
What is a property of a K-ary heap?
What is a property of a K-ary heap?
Which of the following is true about a K-ary heap?
Which of the following is true about a K-ary heap?
What is the parent of a node at index 0 in a K-ary heap?
What is the parent of a node at index 0 in a K-ary heap?
In a K-ary heap, what is the purpose of heapification?
In a K-ary heap, what is the purpose of heapification?
What is an advantage of using a small value of K in a K-ary heap?
What is an advantage of using a small value of K in a K-ary heap?
Flashcards are hidden until you start studying