Linear Probing – Analysis -- Example What is the average number of probes for a successful search and an unsuccessful search for this hash table? - Hash Function: h(x) x mod 11 Successful Search: -...


Linear Probing – Analysis -- Example<br>What is the average number of probes for a successful<br>search and an unsuccessful search for this hash table?<br>- Hash Function: h(x) x mod 11<br>Successful Search:<br>- 20: 9 -- 30: 8 -- 2: 2 -- 13: 2, 3 -- 25: 3,4<br>9.<br>1<br>2<br>24: 2,3,4,5<br>10: 10<br>9: 9,10, 0<br>--<br>--<br>3<br>13<br>Avg. Probe for SS (1+1+1+2+2+4+1+3)/8=15/8<br>%3D<br>4<br>25<br>Unsuccessful Search:<br>- We assume that the hash function uniformly<br>5<br>24<br>distributes the keys.<br>0: 0,1<br>4: 4,5,6 - 5: 5,6 - 6: 6 -7:7 -- 8: 8,9,10,0,1<br>6.<br>1:1 -- 2: 2,3,4,5,6<br>3: 3,4,5,6<br>7<br>--<br>--<br>8<br>30<br>9: 9,10,0,1 -- 10: 10,0,1<br>-<br>9 20<br>Avg. Probe for US =<br>(2+1+5+4+3+2+1+1+5+4+3)/11=31/11<br>%3D<br>10<br>10<br>2.<br>

Extracted text: Linear Probing – Analysis -- Example What is the average number of probes for a successful search and an unsuccessful search for this hash table? - Hash Function: h(x) x mod 11 Successful Search: - 20: 9 -- 30: 8 -- 2: 2 -- 13: 2, 3 -- 25: 3,4 9. 1 2 24: 2,3,4,5 10: 10 9: 9,10, 0 -- -- 3 13 Avg. Probe for SS (1+1+1+2+2+4+1+3)/8=15/8 %3D 4 25 Unsuccessful Search: - We assume that the hash function uniformly 5 24 distributes the keys. 0: 0,1 4: 4,5,6 - 5: 5,6 - 6: 6 -7:7 -- 8: 8,9,10,0,1 6. 1:1 -- 2: 2,3,4,5,6 3: 3,4,5,6 7 -- -- 8 30 9: 9,10,0,1 -- 10: 10,0,1 - 9 20 Avg. Probe for US = (2+1+5+4+3+2+1+1+5+4+3)/11=31/11 %3D 10 10 2.

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here