



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Written homework for cs 2420 summer 2008, focusing on splay trees and hash tables. The tasks include inserting and deleting values in top-down splay trees and b-trees, understanding primary and secondary clustering, and analyzing different collision resolution schemes. Additionally, students are asked to evaluate the appropriateness of various hash functions.
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




CS 2420 Summer 2008 Written Homework 3
In primary clustering, not only do items collide because they hash to the same location, but one item may collide with the alternate location for another. This occurs in linear probing. When the item that hashes to x is placed in y , items that hash to either x or y both try the same next location.
In secondary clustering, two items that hash to the same location follow the same probe sequence for subsequent locations. This happens in quadratic probing. Only items that hash to location x continue to try the same sequence of alternate locations. If something has primary clustering, it will also have secondary clustering.
If a hash method does not exhibit primary or secondary clustering, it is termed non-clustering. This happens with double hashing. Even items which hash to the same location do not continue to try the same sequence of alternate locations because each is using a different step value.
Notice that non-clustering methods are the best, and methods that exhibit primary clustering are the worst.
Consider the following collision resolution schemes. Indicate whether they are non-clustering, secondary clustering, or primary clustering.
a. You use linear probing, but always increment by 3 (rather than 1) in the event of a collision.
Linear Probing
Quadratic Probing Double Hashing Chaining 0 1 2 3 4 5 6 7 8 9
10