What operation is performed to convert a binary heap into a sorted array?
A. Heapsort
B. Merge sort
C. Quick sort
D. Insertion sort
Select an option to see the answer and solution.
In which situation would you prefer using a Fibonacci heap over a binary heap?
A. When frequent decrease-key operations are required.
B. When constructing a priority queue with constant time insertions.
C. When needing to maintain a sorted order.
D. When requiring simple implementation.
Select an option to see the answer and solution.
Which algorithm uses a binary heap to improve its performance?
A. Dijkstra's algorithm for shortest paths.
B. Kruskal's algorithm for minimum spanning tree.
C. Prim's algorithm for minimum spanning tree.
D. Merge sort algorithm.
Select an option to see the answer and solution.
What is the maximum number of children a node can have in a binary heap?
A. 2
B. 3
C. 4
D. No fixed limit
Select an option to see the answer and solution.
How do you ensure that a binary heap remains a valid heap after multiple insertions?
A. By performing a heapify operation after each insertion.
B. By performing a sort operation.
C. By rebalancing the tree manually.
D. By ensuring nodes are inserted in sorted order.
Select an option to see the answer and solution.
Multiplication and division to find children and parents cannot be implemented in a d-heap.
Select an option to see the answer and solution.
A leftist heap is also said to be a binary heap.
Select an option to see the answer and solution.
Who invented d-ary heap?
A. Carl Rick
B. Alan Turing
C. Donald Johnson
D. Euclid
Select an option to see the answer and solution.
What is the child of smallest element of the given minimum ternary heap?
Select an option to see the answer and solution.
Heap can be used as . . . . . . . .
A. Priority queue
B. Stack
C. A decreasing order array
D. Normal Array
Select an option to see the answer and solution.
The procedure given below is used to maintain min-order in the min heap. Find out the missing statements, represented as X.
procedure TrickleDownMin(i)
if A[i] has children then
m := index of smallest of the children
or grandchildren (if any) of A[i]
if A[m] is a grandchild of A[i] then
if A[m] < A[i] then
swap A[i] and A[m]
X: _______________________
____________________
endif
TrickleDownMin(m)
endif
else //{A[m] is a child of A[i]}
if A[m] << A[i] then
swap A[i] and A[m]
endif
endifA. if A[m] > A[parent(m)] then
swap A[m] and A[parent(m)]
B. if A[m] > A[parent(m)] then
swap A[i] and A[parent(m)]
C. if A[m] < A[parent(m)] then
swap A[m] and A[parent(m)]
D. if A[m] > A[parent(m)] then
swap A[i] and A[parent(m)]
Select an option to see the answer and solution.
Why is this heap named leftist heap?
A. only left subtrees exist
B. the tree is biased to get deep down the left
C. it is balanced
D. right trees are unbalanced
Select an option to see the answer and solution.
What is the space complexity of searching in a heap?
A. O(logn)
B. O(n)
C. O(1)
D. O(nlogn)
Select an option to see the answer and solution.
Which of the following operations does not destroy the leftist heap property?
A. insert
B. merge
C. delete
D. swap
Select an option to see the answer and solution.
The main distinguishable characterstic of a binomial heap from a binary heap is that
A. it allows union operations very efficiently
B. it does not allow union operations that could easily be implemented in binary heap
C. the heap structure is not similar to complete binary tree
D. the location of child node is not fixed i.e child nodes could be at level (h-2) or (h-3), where h is height of heap and h>4
Select an option to see the answer and solution.
How many basic operations can be performed in a d-heap?
Select an option to see the answer and solution.
What is the time complexity for deleting root key in a ternary heap of n elements?
A. O (log n/ log 3)
B. O (3log n/ log 3)
C. O (n)
D. O (1)
Select an option to see the answer and solution.
What is the reason for the efficiency of a pairing heap?
A. simplicity
B. time-efficient
C. space-efficient
D. advanced
Select an option to see the answer and solution.
If there are c children of the root, how many calls to the merge procedure is required to reassemble the heap?
Select an option to see the answer and solution.
What is order of resultant heap after merging two tree of order k?
Select an option to see the answer and solution.