Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

when i run thats what i get its error i get 3 times 0 on the assignment i get help on chegg before they help

when i run thats what i get its error
i get 3 times 0 on the assignment i get help on chegg before they help good but now i dont know why it giving me wrong coding and im paying for that to get help
image text in transcribed
image text in transcribed
image text in transcribed
Compilation failed due to following error(s). Compllation falled due to following error(s). Modify the Python hash table implementation with chaining (HashTable.py) so that it doubles the size of the array whenever the number of items in the hash table reaches 70% of the array size. The hash function should be rewritten. Make the list of coefficients self.coeff longer to include 10 or more primes, perhaps starting with a larger prime than 2. Add an additional member variable self.numcoeff that records the number of coefficients from the array self.coeff and number of characters of the word used in computing the hash function. This variable will replace the number 6 in the hash function You should also write a function resize to resize your array. That function should create a new temp list for the table with double the space of the existing self.table. The function should increase self.numcoeffs by 1 . You will need to copy all of the items in the original array into the new array, using the new hash function to compute the index of each item in the new array. Once everything is copied into the temp list, assign that list to the member variable self.table and update the other member variables as needed. Finally, modify the _setitem_ function so that it checks the resizing condition after inserting a new element. If the number of items is 70% or more of the array size after the new element has been inserted, resize the array. The file test_HashTable.py is a test for this improved class. Compilation failed due to following error(s). Compllation falled due to following error(s). Modify the Python hash table implementation with chaining (HashTable.py) so that it doubles the size of the array whenever the number of items in the hash table reaches 70% of the array size. The hash function should be rewritten. Make the list of coefficients self.coeff longer to include 10 or more primes, perhaps starting with a larger prime than 2. Add an additional member variable self.numcoeff that records the number of coefficients from the array self.coeff and number of characters of the word used in computing the hash function. This variable will replace the number 6 in the hash function You should also write a function resize to resize your array. That function should create a new temp list for the table with double the space of the existing self.table. The function should increase self.numcoeffs by 1 . You will need to copy all of the items in the original array into the new array, using the new hash function to compute the index of each item in the new array. Once everything is copied into the temp list, assign that list to the member variable self.table and update the other member variables as needed. Finally, modify the _setitem_ function so that it checks the resizing condition after inserting a new element. If the number of items is 70% or more of the array size after the new element has been inserted, resize the array. The file test_HashTable.py is a test for this improved class

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+What is the nature of the plant or site-level role of unions?

Answered: 1 week ago