Declarations and Implementation for both Classes - Maximum Space Utilization - Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task :

You will implement a LinearHashing class, which provide a hash table for integers. The hash function to be used should be the one discussed in class (the rightmost k bits of the number in terms of binary).The class has the following methods defined:

Constructor
Linear

  • Hashing(int bucketsize, int policy, int maxoverflow, float sizelimit)
  • bucketsize: the maximum number of integers that can be stored in a bucket
  • policy: denoting when should a split occurs

0 (Default) : A split occurs when an insertion to a bucket and that bucket
overflows (as described by the slide)
1: A split occurs only when an item is inserted to the bucket that is to be splitted next and it overflows
2: A split occurs only when the total number of overflow buckets is larger than a limit (to be specified in another parameter)
3: A split occurs only when the total number of  integers in the hash table is equal or larger than a certain ratio of the current capacity of the hash table (to be specified by a certain parameter)
 

The LinearHashing class should have a LinearHashingStats as a member object so that it can capture the statistics.

You are welcomed to make LinearHashing a friend to the LinearHashingStats class – that will make it easier for you to update the values.

 

Program files

  • You should have a file “lh.py” that contains declarations and implementation for both classes.
  • Once again, no actual code to test the classes should be in that file
  •  You are welcomed to write your own “lhmain.py” to test the program.  

 

You need to test the performance of your linear hashing algorithm. You should conduct tests to answer the following questions:

  • Which of the four policies is the best, in terms of minimum amount of access and maximum space utilization? (Notice that it may turns out different policy is the best under different situation)
  •  Will the performance change if the integer to be inserted has different distribution (random vs. (close to) uniform vs. skewed?

You should design and conduct experiments to test each of the options. You should write a 2-4 page report describing your testing efforts and also present and interpret your experimental results).

You must at least answer the first case for randomly generated integers to be inserted.

 

This Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.