Question: 1) Design a data structure called POLYNOMIAL that stores mathematical polynomials of degree up to m . Explain the pros and cons of your design.
1) Design a data structure called POLYNOMIAL that stores mathematical polynomials of degree up to m. Explain the pros and cons of your design.
2) Implement a procedure in your favorite computer language that generates 100,000 random integer numbers between 0 and 1000, and stores these numbers to 4 hash tables. The hash tables should have collision resolution by chaining based on (i) the multiplication hashing method with (a) A=0.2 and m=100, (b) A=0.5 and m=100, and (c) A=0.8 and m=100; and (ii) the division hashing method with (d) m=100. Run your procedure 5 times, and calculate the average number of keys per slot (from the 5 runs). Plot 4 histograms with the results (one for each hash table). Post your code, your results, and a deep analysis of your findings? *Tip: Make sure to seed the random function so the drawn numbers are different each time.
3) Design a (good) hash function to chain integer numbers drawn from a Normal Distribution around a mean value M. *Tip. A Normal Distribution is characterized by a larger frequency of numbers drawn near the mean, and gradually less frequent numbers drawn as they move away from the mean.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
