1/12
Looks like no tags are added yet.
In a Heap data structure implementation, the tree does not have to preserve the binary search tree property.
True
The tree has root A; A has children K and Q; K has left child Z; Q has right child Y. This tree is not complete. True or False?
True
The storage space of a Heap data structure is O(log n). True or False?
False
In an unsorted list implementation of priority queue, what is the worst-case running time of removal? A. O(1) B. O(log n) C. O(n) D. O(n²)
C. O(n)
In a sorted list implementation of priority queue, what is the worst-case running time of insertion? A. O(1) B. O(log n) C. O(n) D. O(n²)
C. O(n)
In the C++ STL class std::priority_queue, what is the insertion operation called? A. insert(…) B. push(…) C. pushEnd(…) D. enqueue(…)
B. push(…)
What is the height of a regular Heap data structure? A. O(n log n) B. O(log log n) C. O(n) D. O(log n)
D. O(log n)
In the array implementation of a Heap, how is the index of the left child determined (with 1-based indexing)? A. nodeIndex + 2 B. nodeIndex / 2 C. nodeIndex % 2 D. nodeIndex * 2
D. nodeIndex * 2
A min-heap has root D; children K and Q; K has children Z and S; Q has left child Y. What is the final heap after inserting B, where A has the highest priority? Give level-order representation.
B, K, D, Z, S, Y, Q (Option C)
What is the array representation (level-order) of the min-heap with root D, children K and Q, K's children Z and S, and Q's left child Y?
D, K, Q, Z, S, Y
Does this tree represent a valid max-leftist-heap after a remove operation? Root G; children F and D; F has children E and B; B has left child A; D has right child C.
No. The leftist property is violated; the source says F and D must be swapped.
What is the worst-case running time for heap sort? A. O(n²) B. O(n log n) C. O(n) D. O(1)
B. O(n log n)
What is the worst-case running time for merging two leftist heaps?
O(log n)