Quadratic probing Suppose that we are given a key k to

Chapter 11, Problem 11-3

(choose chapter or problem)

Quadratic probing Suppose that we are given a key k to search for in a hash table with positions 0; 1; : : : ; m 1, and suppose that we have a hash function h mapping the key space into the set f0; 1; : : : ; m 1g. The search scheme is as follows: 1. Compute the value j D h.k/, and set i D 0. 2. Probe in position j for the desired key k. If you find it, or if this position is empty, terminate the search. 3. Set i D i C 1. If i now equals m, the table is full, so terminate the search. Otherwise, set j D .i C j / mod m, and return to step 2. Assume that m is a power of 2. a. Show that this scheme is an instance of the general quadratic probing scheme by exhibiting the appropriate constants c1 and c2 for equation (11.5). b. Prove that this algorithm examines every table position in the worst case.

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back