0 Replies - 433 Views - Last Post: 01 April 2014 - 04:38 PM Rate Topic: -----

#1 Fluxxxy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-November 12

Receiving same average probe length for every load factor

Posted 01 April 2014 - 04:38 PM

My assignment deals with hashing and using Horner's polynomial to create a hash function. I have to compute the theoretical probe length using ( 1 + 1/(1-L)**2)/2 (Usuccessful) or (1+1/(1-L))/2 (successful) for Linear probing and then the same for the correct equations that correspond to quadratic probing. I then have to compare the theoretical values with experimental values for load factors 0.1 through 0.9. The problem that I am having is that the experimental average probe length is being computed as the same for every load factor. From my understanding it should go up as the load factor increases and I don't know why this is happening. I'm not sure what parts of my code would be helpful to look at so I won't post any of it initially and if someone could tell me what part to post that would be helpful. I will also include a sample output. The same random 10,000 ints are in each HashTable and the same random 100 ints are used to search.

ES = average of the probe lengths for the experimental succcesses.
DS = denominator used to compute ES.
TS = theoretical average probe length for success.

EF = average of the probe lengths for the experimental failures.
DF = denominator uses to compute EF. (DS +DF==100)
TF = theoretical average probe length for failure.
Above is what the abbreviations from the sample data correspond to

Linear Probing
load ES DS TS EF DF TF
---- -- -- -- -- -- --
0.1 47.36 61 1.05 1602.84 39 1.11
0.2 47.36 61 1.12 1602.84 39 1.28
0.3 47.36 61 1.21 1602.84 39 1.52
0.4 47.36 61 1.33 1602.84 39 1.88
0.5 47.36 61 1.5 1602.84 39 2.5
0.6 47.36 61 1.75 1602.84 39 3.62
0.7 47.36 61 2.16 1602.84 39 6.05
0.8 47.36 61 2.99 1602.84 39 12.99
0.89 47.36 61 5.49 1657.0 39 50.49


Quadratic Probing
load ES DS TS EF DF TF
---- -- -- -- -- -- --
0.1 2.57 61 1.05 15.79 39 1.11
0.2 2.57 61 1.11 15.79 39 1.25
0.3 2.57 61 1.18 15.79 39 1.42
0.4 2.57 61 1.27 15.79 39 1.66
0.5 2.57 61 1.38 15.79 39 2.0
0.6 2.57 61 1.52 15.79 39 2.5
0.7 2.57 61 1.71 15.79 39 3.33
0.8 2.57 61 2.01 15.94 39 4.99
0.89 2.62 61 2.55 17.12 39 9.99

Is This A Good Question/Topic? 0
  • +

Page 1 of 1