GATE Exam  >  GATE Questions  >   Load the keys 23, 13, 21, 14, 7, 8, and 15 i... Start Learning for Free
Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.
[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]
How many collisions can occur in the hash table?
  • a)
    8
  • b)
    12
  • c)
    13
  • d)
    10
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash t...
23 ⇒ No collision
13 ⇒ No collision
21 ⇒ No collision
14 ⇒ 1 collision
7 ⇒ 2 collisions
7%7 = 1 (Collision)
[(7%7) + 1] mod 7 = 1 (Collision)
[(7%7) + 4] mod 7 = 4
Similarly, 8 ⇒ 2 collisions
15 ⇒ 3 collisions.
Therefore, total collisions are: 1 + 2 + 2 + 3= 8
View all questions of this test
Most Upvoted Answer
Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash t...
Solution:

Hash Table Size = 7
Hash Function h(key) = key % 7
Quadratic Probing c(i) = ±i^2

Load the keys 23, 13, 21, 14, 7, 8, and 15 in the hash table using quadratic probing.

1. Insert Key 23
h(key) = 23 % 7 = 2
h_0(key) = (23 + 0^2) % 7 = 2
Insert 23 in Hash Table at index 2.

2. Insert Key 13
h(key) = 13 % 7 = 6
h_0(key) = (13 + 0^2) % 7 = 6
Insert 13 in Hash Table at index 6.

3. Insert Key 21
h(key) = 21 % 7 = 0
h_0(key) = (21 + 0^2) % 7 = 0
Insert 21 in Hash Table at index 0.

4. Insert Key 14
h(key) = 14 % 7 = 0
h_0(key) = (14 + 0^2) % 7 = 0
h_1(key) = (14 + 1^2) % 7 = 2
Insert 14 in Hash Table at index 2.

5. Insert Key 7
h(key) = 7 % 7 = 0
h_0(key) = (7 + 0^2) % 7 = 0
h_1(key) = (7 + 1^2) % 7 = 1
h_2(key) = (7 + 2^2) % 7 = 2
h_3(key) = (7 + 3^2) % 7 = 5
Insert 7 in Hash Table at index 5.

6. Insert Key 8
h(key) = 8 % 7 = 1
h_0(key) = (8 + 0^2) % 7 = 1
h_1(key) = (8 + 1^2) % 7 = 4
h_2(key) = (8 + 2^2) % 7 = 0
h_3(key) = (8 + 3^2) % 7 = 4
h_4(key) = (8 + 4^2) % 7 = 3
Insert 8 in Hash Table at index 3.

7. Insert Key 15
h(key) = 15 % 7 = 1
h_0(key) = (15 + 0^2) % 7 = 1
h_1(key) = (15 + 1^2) % 7 = 2
h_2(key) = (15 + 2^2) % 7 = 0
h_3(key) = (15 + 3^2) % 7 = 4
h_4(key) = (15 + 4^2) % 7 = 6
h_5(key) = (15 + 5^2) % 7 = 5
h_6(key) = (15 +
Explore Courses for GATE exam

Similar GATE Doubts

Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer?
Question Description
Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer?.
Solutions for Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Load the keys 23, 13, 21, 14, 7, 8, and 15 in this order, in a hash table of size 7 using quadratic probing with c(i)= ±i^2 the hash function h(key) = key % 7.[Note: The required probe sequences are given by: h_i (key)= (h(key)±i^2 )%7,i=0,1,2,3,....]How many collisions can occur in the hash table?a)8b)12c)13d)10Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev