1. Imagine that you alter the linear probing scheme of Segment 22.13 as follows. When a collision occurs at hash Table[k], you check hash Table [k + c], hash Table [k + 2 * c], hash Table [k + 3 * c], and so on, where c is a constant. Does this scheme eliminate primary clustering?
2. Segment 22.18 defines the method linear Probe. Define the method double Probe to perform probing using double hashing.
3. Consider data whose search key consists of three floating-point values (longitude, latitude, and altitude, for example). Suggest at least two possible hash functions for this data.
4. You have approximately 1000 thumbnail images that you want to store in a dictionary that uses hashing in its implementation. Each image is 20 pixels wide by 20 pixels high, and each pixel is one of 256 colours. Suggest some possible hash functions that you could use.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here