Assignment_W3

Assignment_W3 - uniform. Let be the load factor of the hash...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
EECS 233 Written Assignment #3 Due March 18, 2008 (midnight, 23:59:59) (18 points) 1. Chapter 6, Exercise 6.2 (3points) 2. Consider two efficient algorithms for the selection problem we discussed as an application of heaps (see lecture 13 slides 11 and 12; similar algorithms are discussed as Algorithm 6a and 6b in sec. 6.4.1 of the book). We discussed that both algorithms exhibit similar running time when k is small (constant) and large ( Θ (N)). Which of the algorithms has a better running time bound for intermediate values of k, that is when k is not constant (e.g., it does grow with N) but its growth is sub-linear? (3 points) 3. Chapter 5, Exercise 5.1 (3 points) 4. Chapter 5, Exercise 5.8 (3 points) 5. Assume we use double hashing to handle collisions, and that both hash functions are independent and
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: uniform. Let be the load factor of the hash table. (a) The typical method of inserting a new key with double hashing is to first calculate the two hash values, and then to probe for an open position for the new key. What is the expected number of probes in order to find an open position, as a function of ? (3points) (b) Assume that instead of computing the two hash values at the start, we compute just the first hash value initially and compute second hash value only when the position given by the first hash value is occupied and so probing is needed. On average, how many hash values will be calculated then to insert a new key (as a function of )? (3points)...
View Full Document

Ask a homework question - tutors are online