Problem 1 [8 pts] (R-9.14) Let T be a complete binary tree such that position p stores
an element with key f(p), where f(p) is the level number of p (see Section 8.3.2). Is tree
T a heap? Why or why not?
Problem 2 [12 pts] (R-9.16) Is there a heap H storing seven entries with distinct keys
such that a preorder traversal of H yields the entries of H in increasing or decreasing order
by key? How about an inorder traversal? How about a postorder traversal? If so, give an
example; if not, say why.
Problem 3 [8 pts] (R-9.7). Illustrate the execution of the selection-sort algorithm on the
input sequence: (22, 15, 36, 44, 10, 3, 9) following Figure 9.7.