Question
Which of the following statements is true? Select the best answer. a. Neither tree is a complete binary tree. b. The right tree is a
Which of the following statements is true? Select the best answer.
a. Neither tree is a complete binary tree.
b. The right tree is a complete binary tree.
c. The left tree is a complete binary tree.
d. Both trees are complete binary trees.
List the content of the array that is used to implement the following min heap, from index 1 to the index of the last node of the heap. (The cell at index 0 is not used.)
For example, given the following array,
the content of the array is listed as follows: 16 14 10 8 7 9 3 2 4 1.
Using a heap, the insert() operation incurs running time of
a. O(logn)
b. O(nlogn)
c. O( n )
d. O(1)
Using a heap, the min() operation incurs running time of
a. O(logn)
b. O(nlogn)
c. O(1)
d. O( n )
Using a heap, the removeMin() operation incurs running time of
a. O(1)
b. O(nlogn)
c. O(logn)
d. O( n )
Upheap percolation (or bubbling) restores the heap-order property after
a. either a new entry is added to or an entry is removed from the heap
b. an entry is removed from the heap
c. a new entry is added to the heap
Downheap percolation restores the heap-order property after
a. an entry is removed from the heap
b. a new entry is added to the heap
c. either a new entry is added to or an entry is removed from the heap
What is the heap-order property in a max heap?
a. key(parent) > key(left child) and key(parent)
b. key(parent) > key(child)
c. key(parent)
1 1 2 3 2. 3 5 6 4 5 7 2 4. 7 8 16 9 ) (13 11 1 2 3 4 5 6 7 8 9 10 16 14 14 10 8 7 93 2 4. 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started