CIS2168 TEN MINUTE TEST # 10 November 16, 2010 (10) 1. (a) What makes for a good hash function? (b) What is a collision? (c) What is collision resolution? (15) 2. The Comparator interface defines the method int compare(Pair o1, Pair o2). (a) Implement that interface and methods for a class Pair that has two fields: key, a String, and value, also a String. We want the compare to be based only on the key field. (b) Show how we will use this comparator to sort an array of Pair. (15) 3. Implement the static function public static int leaves(BinaryTree root) which returns the sum of all the integers stored at leaves of the tree rooted at root.