Min heap can be used to implement selection sort.
Select an option to see the answer and solution.
What would be the result if the left subtree of the root has a null path length of 1 and the right subtree has a null path length of 2?
A. merge occurs without violation
B. violation at left subtree
C. violation at right subtree
D. violation at the root
Select an option to see the answer and solution.
What will be the order of new heap created after union of heap H1 and H2 when created by the following code.Initially both are of the order n.
FIB_UNION(H1,H2)
{
H =MAKE_HEAP()
min[H]= min[H1]
concatenate the root list of H2 with the root list of H
if (min[H1] = NIL) or (min[H2]!= NIL and min[H2] < min[H1])
then min[H] = min[H2]
n[H]= n[H1] + n[H2]
free the objects H1 and H2
return H
}Select an option to see the answer and solution.
What is the complexity of adding an element to the heap.
A. O(log n)
B. O(h)
C. O(log n) & O(h)
D. O(n)
Select an option to see the answer and solution.
Is decrease priority operation performed more quickly in a ternary heap with respect to the binary heap.
Select an option to see the answer and solution.
Do ternary heap have better memory cache behavior than binary heap.
Select an option to see the answer and solution.
d-heap is similar to that of a?
A. binary heap
B. fibonacci heap
C. leftist heap
D. treap
Select an option to see the answer and solution.
What is the fundamental operation on leftist heap?
A. insertion
B. merging
C. deletion
D. swapping
Select an option to see the answer and solution.
What is the smallest element of the given minimum ternary heap?
Select an option to see the answer and solution.
State the complexity of algorithm given below.
int function(vector<int> arr)
int len=arr.length();
if(len==0)
return;
temp=arr[len-1];
arr.pop_back();
return temp;A. o(n)
B. O(logn)
C. O(1)
D. O(n logn)
Select an option to see the answer and solution.
What is the process of building a ternary heap called?
A. Heapify
B. Hashing
C. Linking
D. Merging
Select an option to see the answer and solution.
Which operation is not efficiently performed in a d-heap?
A. insert
B. delete
C. find
D. merge
Select an option to see the answer and solution.
In a binary min heap containing n elements, the largest element can be found in . . . . . . . . time.
A. O(n)
B. O(nlogn)
C. O(logn)
D. O(1)
Select an option to see the answer and solution.
What is the worst case time in searching minimum value in weak -heap?
A. O(log n)
B. O(n)
C. O(n logn)
D. O(1)
Select an option to see the answer and solution.
Pairing heaps time complexity was inspired by that of?
A. splay tree
B. treap
C. red-black tree
D. avl tree
Select an option to see the answer and solution.
What is the time complexity for inserting a new item in a ternary heap of n elements?
A. O (log n/ log 3)
B. O (n!)
C. O (n)
D. O (1)
Select an option to see the answer and solution.
What will be the position of 5, when a max heap is constructed on the input elements 5, 70, 45, 7, 12, 15, 13, 65, 30, 25?
A. 5 will be at root
B. 5 will be at last level
C. 5 will be at second level
D. 5 can be anywhere in heap
Select an option to see the answer and solution.
What are the siblings of smallest element of the given maximum ternary heap?
Select an option to see the answer and solution.
What is the time complexity for decreasing priority of key in a minimum ternary heap of n elements?
A. O (log n/ log 3)
B. O (n!)
C. O (n)
D. O (1)
Select an option to see the answer and solution.
Choose the correct properties of weak-heap.
A. Every node has value greater than the value of child node
B. Every right child of node has greater value than parent node
C. Every left child of node has greater value than parent node
D. Every left and right child of node has same value as parent node
Select an option to see the answer and solution.