1. Assume you're given an array with the following character values stored in positions 0 through 12:
    '\0' 'b' 'd' 'm' 'f' 'r' 'v' 'p' 'q' 'h' 'w' 'j' 'z'

    (a) Draw the heap corresponding to this array (remember that the 0th position represents a sentinel value).
    (b) Show the heap after Insert('k') is called.
    (c) Show the heap from part (b) after DeleteMin() is called.
    (d) Show the heap from part (c) after DecreaseKey() is called on the node with value 'p' to lower it to 'a'.
    (e) Show the heap from part (d) after IncreaseKey() is called on the node with value 'f' to raise it to 'm'.
    (f) Show the heap from part (e) after Delete() is called on the node with value 'h'.

  2. Implement BuildHeap() for an integer heap as we discussed in class so that it runs in linear time:
        void BuildHeap(integer input[],int numelems);
    
    The number of elements given to you in the array is indicated by numelems, and these values will be stored at positions 0..numelems. Your heap should store the root at position 1 as we've discussed in lecture and should store a sentinel that is appropriate for the input values at position 0. You should return the heap using the same array and you may assume that the user has allocated plenty of extra memory for you to store the extra value at the end of the array (as well as any end-of-array sentinel values if you wish).

  3. Imagine that you run a dating service and receive the following request from a client:
    "I am looking for someone to date. The most important criteria to me is that the person is intelligent. They should have scored at least 1100 on their SATs, and the better they did, the more attractive I would find them. The next most important characteristic is height. I'm 5' 11" and would ideally like someone my same height. For every inch shorter or taller than me that they are, I'd be a bit less interested."
    Fortunately for you, you happen to have SAT scores and heights for all the people in your database. Even more fortunately for you, you took CSE 373, so you know about heaps. In a few sentences explain how you could use a heap to find the top matches for this client.