Answered step by step
Verified Expert Solution
Question
1 Approved Answer
EXAMPLE BELOW: Question: Demonstrate the insertion of keys 93,40,47,55 into a hash table using open addressing with double hashing scheme. Let the hash table have
EXAMPLE BELOW:
Question: Demonstrate the insertion of keys 93,40,47,55 into a hash table using open addressing with double hashing scheme. Let the hash table have 7 slots, and let the hash function be h(k)=kmod7 and R=5 Hints: h(k,i)=(h1(k)+f(i))modmh1(k)=kmodmf(i)=i(h2(k)),i=0,1,2,3,4,m1h2(k)=R(kmodR) - Insert keys 89,18,49,58,69 using double hashing with m=10 and R=7 Double hashing h(k,i)=(h1(k)+f(i))modm; where h1(k)=kmodm,f(i)=ih2(k) where i=0,1,2m1, and h2(k)=R(kmodR) To insert key 89: h1(k)=kmod10h1(89)=89mod10=9h2(k)=R(kmodR)h2(89)=7(89mod7)=2f(i)=ih2(k)f(0)=02=0[fori=0] L=h(k,i)=(h1(k)+f(i))modmh(89,0)=(9+0)mod10=9 T[9] empty ? Yes. Number of Probe 1 Probe sequence =T[9] Question: Demonstrate the insertion of keys 93,40,47,55 into a hash table using open addressing with double hashing scheme. Let the hash table have 7 slots, and let the hash function be h(k)=kmod7 and R=5 Hints: h(k,i)=(h1(k)+f(i))modmh1(k)=kmodmf(i)=i(h2(k)),i=0,1,2,3,4,m1h2(k)=R(kmodR) - Insert keys 89,18,49,58,69 using double hashing with m=10 and R=7 Double hashing h(k,i)=(h1(k)+f(i))modm; where h1(k)=kmodm,f(i)=ih2(k) where i=0,1,2m1, and h2(k)=R(kmodR) To insert key 89: h1(k)=kmod10h1(89)=89mod10=9h2(k)=R(kmodR)h2(89)=7(89mod7)=2f(i)=ih2(k)f(0)=02=0[fori=0] L=h(k,i)=(h1(k)+f(i))modmh(89,0)=(9+0)mod10=9 T[9] empty ? Yes. Number of Probe 1 Probe sequence =T[9]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started