1. Do problem 12-2. Why does this sorting algorithm not obey the lower bound for comparison sorting algorithms which we proved in class?
2. As we observed in class, when we store n items into a hash table of size m, even if we have a very good hash function h, the expected number of other items in the chain at h(x) is O(n/m), for any item x. If n gets too large, this means that the search operation cannot be performed in expected time O(1).
Design a data structure in which m, the size of the table, changes in response to fluctuations in n, so that for some constant c, c <= n/m <= 4c, and for which the operations insert, delete and search all require expected time O(1).
3. If we apply the function g(x) = (ax + b) mod p to all the elements x in {0,...,p-1}, getting { g(0), g(1), ... , g(p-1)}, we get a permutation of the set {0,...,p-1} (recall that a belongs to {1,...,p-1} and b belongs to {0,..,p-1}).