0) Review any questions from old exams (test1, test2, test3, or test4), especially anything that you may have missed/not understood.... Binary Search Trees ==================== For all questions, assume that you have a typical BSTNode (with Comparable data, and BSTNodes for left and right), and a BST class with a root of type BSTNode. 1) A reverseOrder traversal prints the elements in a BST in reverse order- namely, largest to smallest (whereas an inorder traversal prints them smallest to largest). , write the method public void reverseOrder() in the class BST, which implements a reverseOrder traversal. 2) Assume that you are given method private Comparable yank(BSTNode curr) in the BST class which takes a BSTNode and deletes its left-most right child, and then returns the data from the node that was just deleted. (i.e. from curr, if you went right once, then as far left as possible, the data in the node you found would be returned, and the node would be delted. Write the method public Comparable delete(Comparable toDel) which deletes the first item found in the tree matching toDel, and returns the data in the node deleted. 3) Write the method public int countLargerThan(Comparable c) which returns a count of the number of items larger than c. Your method must make use of the BST's properties (i.e you should not compare every item in the tree to c in all cases). 4) Write the method public int getHeight() which returns the height of the tree. 5) Write the method public boolean isFull() which returns true if the tree is full, false if it is not. Remember that a full tree is a tree in which each node has either exactly 0 or exactly 2 children. The empty tree is considered to be full. Heaps ===== For all coding questions, you may assume that the Heap has a Vector, which holds Comparables called "data". You may also assume that the constructor initalizes the 0 element of the Vector to contain null, and that the Heap is a min heap. 6) Given the following min-heap: 23 / \ 45 56 / \ / 53 48 112 a) show the heap in an array representation. b) add 11 to the heap, show all steps c) remove min, show all steps 7) Write the method public void add(Comparable c) which adds the item to the heap. 8) Write the method public Comparable peek() which returns the smallest element in the Heap, without affecting the contents of the Heap. 9) Write the method private void heapify(int index) which performs the heapify operation in the standard manner starting at the given index. 10) Write the method public Comparable removeSmallest() which removes the smallest item, and then returns it. Sorting ======= 11) Implement the following sorting methods based on the algorithm corresponding to the method name: a) public Comparable[] bubbleSort(Comparable[] data) b) public Comparable[] insertionSort(Comparable[] data) c) What is the running time ("Big-Oh") of these two algorithms? 12) You need to write a program that will sort massive ammounts of data (say 50 million elements at a time). The sorting must be accomplished quickly, and due to memory constraints, you must sort in place [i.e. you may not allocate other arrays]. a) Which sorting algorithm do you choose? b) What is the "Big-Oh" of this algorithm? c) Name another algorithm with this same "Big-Oh" d) Explain why your choice of algorithm is better than the other one with the same running time. 13) Given the following code: public class Sort1 { public static void printArray(int[] data){ System.out.print("["); for(int i=0;idata[l] && adata[l] && a