Note: This assignment is worth 8% of the course grade. It is due in class on March 20, since sketches of the solutions will be handed out on that day.
Answer part a with respect to the code in the text.
Option: You may take inspiration, even code, from the heapsort implementation in ~saunders/320/sort/heapSort.h on the composers. Note that downHeap there is a version of fixheap.
(b) In a heap of size 26, how many positions are possible locations of the third largest element? Draw the heap as a tree and mark the positions where the third largest might reside.
(c) Extra credit: Implement your third-largest function of part (a).
(d) Extra credit contest: Of those who implement the function, get a prize for winning the contest by using the fewest comparisons. To win, your program must first be correct on all inputs, then must have fewest comparisons on the test case.
About extra credit: Extra credit points add to your score but not beyond points taken off on other homework problems.