1. The mode of a set of numbers is the number that occurs most frequently in the set. The set (4, 6, 2, 4, 3, 1) has a mode of 4. Give an efficient and correct algorithm to compute the mode of a set of n numbers.
2. Given a set S of n integers and an integer T, give an O(nk-1 log n) algorithm to test whether k of the integers in S add up to T.