Question: I am making hash table(singly linked list) using C language. I attached hashTable.c & hashTable.h & test file. I failed AccessTest.GetSingleKey test. I got some

I am making hash table(singly linked list) using C language. I attached hashTable.c & hashTable.h & test file.

I failed "AccessTest.GetSingleKey" test. I got some advice to solve this problem like I attached below. Please help me to fix my code with the description below. Method functions are explained in the code as well.

Thank you for your help!

---Advice message:

I am making hash table(singly linked list) using C language. I attached

This test is calling getltem which should use finditem to lookup the HT entry with certain key AND if it finds such an entry, it should return the entry's value. Some bugs in removeltem: . be sure to initialize oldValue to NULL . head = head->next; is one of the bugs in Common Memory Errors.pptx. The local variable "head" is lost when removeltem returns. You need to assign update the hashtable buckets array instead. In deleteltem, you need to call removeltem but also free the value that is returned by removeltem. Also, in destroyHash Table, be sure to free the entry's value when you free the entry and free the hashtable buckets array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!