Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. In a heap, the upper bound on the number of leaves is: (A) O(n) (B) O(1) (C)

ID: 3583250 • Letter: 1

Question

1. In a heap, the upper bound on the number of leaves is: (A) O(n)
(B) O(1) (C) O(logn) (D) O(nlogn)
2. In a heap, the distance from the root to the furthest leaf is:
(A) (nlogn) (B) (logn)
(C) (1) (D) (n)
3. In a heap, let df be the distance of the furthest leaf from the root and let dc be the analogous distance of the closest leaf. What is df dc, at most?
(A) 1 (C) 2
(B) (logn) (D) 0
4. What is the most number of nodes in a heap with a single child?
(A) 0 (D) (logn)
(B) (n) (C) 2
(E) 1
5. What is the fewest number of nodes in a heap with a single child?
(A) 0 (C) one per level (B) 1 (D) 2
6. T or F: There can be two or more nodes in a heap with exactly one child.
7. T or F: A heap can have no nodes with exactly one child.
8. T or F: All heaps are perfect trees.
9. T or F: No heaps are perfect trees.
10. T or F: All heaps are complete trees.
11. T or F: No heaps are complete trees.
12. T or F: A binary tree with one node must be a heap.
13. T or F: A binary tree with two nodes and with the root having the smallest value must be a min-heap.
14. T or F: If a node in a heap is a right child and has two children, then its sibling must also have two children.
15. T or F: If a node in a heap is a right child and has one child, then its sibling must also have one child.

Explanation / Answer

1. In a heap, the upper bound on the number of leaves is

(B) O(1)

2. In a heap, the distance from the root to the furthest leaf is

(D) (n)