Anda di halaman 1dari 1

# EECS 4101 2017 Assignment 1

## Please type. Clarity and correctness both count.

Acknowledge all sources of ideas except book and/or class

## 1: Dynamic Table. Try to get simple, reasonable good amortized costs.

(a)Devise a table expansion policy as in section 17.4.1 to keep the storage
utilization 66% with constant amortized cost. Describe the policy,
specify the amortized cost and justify that the policy has constant amortized
cost for insertion using the banker or potential method.
(b)Devise a table expansion and contraction policy as in section 17.4.2 that
keeps the storage utilization above 60% with constant amortized cost.
Describe the policy, specify the amortized costs and justify that the policy
has constant amortized cost for insertion and deletion using the potential
method.

2: Consider inserting the following keys (in this order) into a hash table of size 11
using hash functions
1 (x) = x mod 11 and 2 (x) = x mod 9 +1.
Keys: 6, 12, 31, 4, 15, 28, 17, 88, 59 when the hash table uses:
(a) Double hashing with pass bits
(b) Ordered (double) hashing with pass bits (use the Bully algorithm)
Calculate the final search cost for each key, and calculate the average successful
search cost for the keys in the table.

## 3: CLRS 13-4 parts a, b, c, d on page 334 (TREAPS). Dont be tempted to consult

internet sources, we will recognize them. Use techniques of class. You can assume
results of CLRS 12.4 (on height of random search trees.)

4: Analyze the lists with move-to-front problem where items (once found in th
elist) may be covered forward to any position ahead of them, not just to the front.
What is the competitive ratio in this case? Justify.

5: Show how to modify the skip list data structure to support an additional
operation Skip-List-Get(i), that returns a pointer to the ith element in the list (with
- as element 0 and as element n+1) and prove that the new operation requires
expected time O(log n) with high probability (if possible) while maintaining
expected O(log n) time search with inserts.