line art

Performance and Test, Spring 2008: Episode 3.2

line art
Spring 2008 Description Schedule Resources
line art

Lecture Friday, February 15, 9:00—11:00, Room 3A14

Subject : Hashing.

Text : RS 14.0, 14.1, 14.2, 14.5, this note, pages 1—5 of this article [30pp, 4h].

Downloads: Lecture slides.



Exercises, Wednesday, February 20, 11:00—12:00, Room 3A14.

Some of the following exercises will be discussed at the exercise session. The exercised marked [CLRS] are taken from another textbook (by Cormen, Lester, Rivest, and Stein) — you do not need that book to solve the exercises.

  1. Discuss with your group partner what is the advantage of cuckoo hashing over hashing with chaining? (hint: summarize complexities of operations and compare them)

  2. Let m be the size of a hash table. Show that if |U| > nm, there is asubset of U of size n consisting of keys that all hash to the same slot, so that the worst-case searching time for hashing with chaining is linear. [Taken from CLRS 11.2-5]

  3. Suppose we wish to search a linked list of length n, where each element contains a key k along with a hash value h(k). Each key is a long character string. How might we take advantage of the hash values when searching the list for an element with a given key? [Taken from CLRS 11.3-1]

  4. RS 14.42, 14.43, p. 629

In addition, you must hand in a solution to the following problem before Wednesday, Feb 27, at 11:00. You can hand in at the beginning of the lecture Wednesday morning, or at any other time in the course pigeon hole, in front of the study administration.