Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed
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

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

Step: 3

blur-text-image

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

=+ How can risk of failure in introducing

Answered: 1 week ago