Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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 arrayStep 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