Question 21
Which of the following is a valid heap ?
A 16 14 10 4 7 9 3 2 8 1
B 16 14 10 8 7 9 3 2 4 1
C 16 14 10 8 1 9 3 2 4 7
D 16 14 3 4 1 9 10 8 2 7
Question 24
Question 25
Consider the array representation of a binary min-heap containing 1023 elements. The minimum number of comparisons required to find the maximum in the heap is _________ .
Question 26
Let H be a binary min-heap consisting of n elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in H?
Question 27
Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks like this: 16 14 15 10 12 27 28 How many heapify operations have been performed on root of heap?
Question 28
Which languages necessarily need heap allocation in the run time environment?
There are 30 questions to complete.