+1-415-670-9189
info@expertsmind.com
Implement an open hash table
Course:- Data Structure & Algorithms
Reference No.:- EM13412




Assignment Help
Expertsmind Rated 4.9 / 5 based on 47215 reviews.
Review Site
Assignment Help >> Data Structure & Algorithms

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

You will use the table to compare two Shakespeare plays: Hamlet and As You Like It. You will report the number of words that Shakespeare used in both plays.  Have your program read the file hamlet.txt and insert each word into the table. For this assignment, a word will be delimited by a white space, so simple input with >> can be used.  Some of the words will, of course, be nonsense, but we will ignore this.  After inserting all the words from Hamlet, do a lookup for words from the file asyoulikeit.txt.  Store and count the words that are duplicated in the two plays (i.e. words for which the search is successful).  Your count may be slightly less than accurate in reality, since we will not strictly parse the words.  However, each student should come up with the same list of words and the same count.  For each word you insert, compute the number of elements in the bucket that are searched.  Likewise, compute the number of unsuccessful searches.  Report the average number of elements inspected during a search (average number per bucket).   Determine if this is close to the expected size based on the load factor after all words have been inserted.

Repeat your experiment with table sizes of 27691, 55381 and 83,077 using each of the four hash functions.

Data Structures:

  • The hash table must be a template class which uses a linked list to store collisions
  • The underlying physical structure can be a simple, dynamically allocated array or a vector.  
  • The hash table will use an abstract hashing class and four subclasses



Put your comment
 
Minimize


Ask Question & Get Answers from Experts
Browse some more (Data Structure & Algorithms) Materials
Create a 12 slide presentation describing the data types. Include the following in your presentation: Introductory slide Slide for each data type (containing a definition of t
Your goal is to solve the following simple programming exercise. You have been asked by your accounting department to design an algorithm determining the annual profit fo
At this point, you decide to implement a Hash structure for the contributor data to prepare for searches. You will read the contributor information from a file provided; it
Given an array s =(s[1], s[2], . . . , s[n]), and n = 2^d for some d = 1. We want to find the minimum and maximum values in s. We do this by comparing elements of s.
Assume two TCP connections are available over some bottleneck link of rate R bps. Both connections have a huge document to send in the similar direction over the bottleneck li
Write an algorithm, using pseudo code, "Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options.
Data structures include: 1. a linked list, 2. an ordered, one dimensional array, and three. a binary tree. Assume the list of letters R, A, N, B, C, F, X and G are stored in a
Are the following TriMedia instructions allowed, and if not, why not? Integer add, integer subtract, load, floating add, load immediate. Integer subtract, integer multiply,