Name: ________________________________

CSE373 Spring Quarter
University of Washington
Miniquiz #8
April 29, 2005
Closed book, closed notes, closed neighbor; no calculators
1 point per part except as noted

. (2 pts.)
Draw a "complete" binary tree with exactly 10 nodes.  Leave the nodes unlabeled.

 

 

 

 

 

 

Check: all levels full except the last one, all nodes at lowest level as far to the left as possible
 
. (2 pts.)
Suppose a node in a tree has the value 5, its left child has the value 3, and its right child has the value 7.  Could this be part of a tree which has the "heap property"?  Explain briefly.

 

 

 

No.  If min-heap, both children would need to be greater than 5.  If max-heap, both would need to be less.  (Min is kind of the default -- your answer doesn't need to mention both the min and max cases).
 
. (1 free bonus pt.)
Choose all that apply:
  1. I can't believe we had two quizzes in one week!
  2. I can believe we had two quizzes in one week!