recategorized by
3,247 views
3 votes
3 votes

Consider a 13 element hash table for which f(key)=key mod 13 is used with integer keys. Assuming linear probing is used for collision resolution, at which location would the key 103 be inserted, if the keys 661, 182, 24 and 103 are inserted in that order?

  1. 0
  2. 1
  3. 11
  4. 12
recategorized by

3 Answers

Best answer
9 votes
9 votes
0 182
1 103
2  
3  
4  
5  
6  
7  
8  
9  
10  
11 661
12 24

 

Option(B) 1

selected by
8 votes
8 votes
661 mod 13 =11 so 11th location

182 mod 13 =0 so 0th location

24 mod 13 =11 but 11 is filled so it will occupy next available free space so 12 th location

103 mod 13 =12 which is filled hence next which is 0  again filled so next which is 1

so ans is B
Answer:

Related questions

2 votes
2 votes
0 answers
2
0 votes
0 votes
1 answer
3
Ray Tomlinson asked Aug 9, 2023
481 views
Numerical Answer Type Que?(please Try to give some ahortcut trick also or important concept is there to solve that question )