WorksheetsBinary Heap
Total questions: 9
Worksheet time: 45mins
Which of the following is a max-heap?
Consider a binary max-heap implemented using an array. Which one of the following array represents a binary max-heap?
25,12,16,13,10,8,14
25,12,16,10,13,8,14
25,14,16,13,10,8,12
25,14,12,13,10,8,16
In a binary max heap containing n numbers, the smallest element can be found in time ?
O(n)
O( Log(n) )
O( Log(Log(n)) )
O(1)
In a binary max heap containing n numbers, the smallest element can be found in time ?
O(n)
O( Log(n) )
O( Log(Log(n)) )
O(1)
The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The resultant Max Heap is.
Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4. Now consider that a value 35 is inserted into this heap. After insertion, the new heap is
40, 30, 20, 10, 15, 16, 17, 8, 4, 35
40, 35, 20, 10, 30, 16, 17, 8, 4, 15
40, 30, 20, 10, 35, 16, 17, 8, 4, 15
40, 35, 20, 10, 15, 16, 17, 8, 4, 30
The minimum number of interchanges needed to convert the array 89, 19, 40, 17, 12, 10, 2, 5, 7, 11, 6, 9, 70 into a max heap
0
1
2
3
Given a binary-max heap. The elements are stored in an arrays as 25, 14, 16, 13, 10, 8, 12. What is the content of the array after two delete operations?
14,13,8,12,10
14,12,13,10,8
14,13,12,8,10
14,13,12,10,8
On which algorithm is heap sort based on?
Fibonacci heap
Binary tree
Priority queue
FIFO
