SUNY Geneseo Department of Computer Science
CSci 240, Spring 2007
Prof. Doug Baldwin
Due Monday, April 23
Solve the following problems.
Draw a min-heap containing the numbers 5, 2, 3, 1, 9, 8, 10, and 12, ordered in conventional numeric order.
Draw a max-heap containing the strings "apple," "pear," "banana," "canteloupe," and "nectarine," ordered by alphabetical order.
Draw a max-heap containing the numbers 1, 4, 2, 1, 3, and 7, ordered in conventional numeric order.
Here is a min-heap of numbers, ordered in conventional numeric order:
Show two distinct heaps that could result from inserting 20 into this heap.
Show two distinct heaps that could result from removing the minimum value from this heap.
Show a heap equivalent to the one above (without the insertions or deletions) that is a complete tree.
I will grade this exercise in a face-to-face meeting with you. Make an appointment to meet with me at some time convenient for you, as long as that time is before the end of the due date above. Meetings only need to be 15 minutes long. You can make an appointment by signing up on the copy of my schedule on the bulletin board outside my office.