Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java, this class is a Hashtable with chaining, the put function resizes properly, howverr even when the size is correct, it will still store

in java, this class is a Hashtable with chaining, the put function resizes properly, howverr even when the size is correct, it will still store them in the index of 11 instwad of finding a new index since it is full, please help edit this
image text in transcribed
image text in transcribed
image text in transcribed
Chainingjava. 3 34 usige public void put (a key, vatue) f int index = getIndex ( key ); LinkedList= null) 1 chain = new Linkeoliste 0 ; table, set(index, chain); ) II check if the key already exists and update the value for (Entryek, vo entry : chain) i if (entry,gotkey 0 . equats (key)) i entry, setvatue(vatue); return; 3 1 II If the key is not foune, ads the new entry to the chain chain,ado(new Entryes(key, vatue)); tizet+i restrect) I atage private boblean fsprine(int inuede) t hashTable.put (50,50); hashTable.put (147,147); hashTable.put (32,32); hashTable.put (45,45); hashTable.put (57,57); hashTable.put (68,68); hashTable.put (72,72); hashTable.put (84,86); hashTable.put (98,98); hashTable.put (18,10); hashTable.put (11,11); hashTable.put (15,15); hashTable.put (8,8); hashTable.put (22,22); hashTable.put (31,31); hashTable.put (77,27); hashTable.pur (17,17); hashTable.put (66,60); hashTabte.put (19,19); System. out. printin(hashTabte); 2:98=98,33:808,31=31,77=77,i4:147=167,32=32,;5:18=10,;6:11=11,57=57,77:84=86,15=15;;8:17=17,;9:1919,;10:66=60,;11:45=45,68=468,22=22} n exit cote

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions