CIS2168 TWENTY MINUTE TEST #12 November 30, 2010 (15) 1. We are sorting the array {4,2,5,3,1} using heapsort. Show the various stages of the heap tree as values are first all inserted then all removed. (15) 2. We are sorting the array {4,2,5,3,1} using QuickSort. Show the various stages of the array after each use of the partiion algorithm. [After the first pass you recurse on more than one subarray. For example, if the initial array is 7,5,9,8,1,3,2 the successive arrays are 1,5,2,3,7,8,9 1,3,2,5,7,8,9 1,2,3,5,7,8,9 (15) 3. Write the method public static int perfect(BinaryTree root) that returns -1 if root denotes a tree that is not perfect (i.e. all leaves are at the same distance from root), or its height, if it is.