b. the last node in the heap
c. the left child of the root
d. the right child of the root
#
22. Suppose a heap is stored in an array list as follows: {100, 55, 92, 23, 33, 81}. After inserting 103, what is the
content of the array list?
a. {100, 55, 92, 23, 33, 81, 103}
b. {100, 55, 103, 23, 33, 92, 81}
c. {103, 55, 92, 23, 33, 81, 92}
d. {103, 55, 100, 23, 33, 81, 92}
e. {103, 55, 92, 23, 33, 81, 100}
#
Section 23.6.3 Removing a New Node
15. To remove the root, you need to start a process by first placing to the place of the root and move it down
to maintain the heap property.
a. one of the root’s children
b. the larger child of the root
c. the smaller child of the root
d. the last node in the heap
#
Section 23.6.6 Heap Sort Time Complexity
19. The worst–time complexity for heap sort is
a. O(1)
b. O(logn)
c. O(n)
d. O(nlogn)
e. O(n*n)
#
20. The average-time complexity for heap sort is
a. O(1)
b. O(logn)
c. O(n)
d. O(nlogn)
e. O(n*n)
#
Section 23.7 Bucket Sort and Radix Sort
23. The most efficient algorithm for sorting integer keys is .
a. quick sort
b. merge sort
c. heap sort
d. radix sort
#