+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
Why do we need so many different ways to represent data? Efficiency related to working with different number bases. When and why might we need to use a base greater than 16?
Imagine you are asked to write a program to print out a yearly calendar. In this program, the user enters the year desired, and the output is a calendar for that year. Deter
Design a dynamic programming algorithm to find the value of the optimal plan. Implement your algorithm using any programming language you prefer. Describe the recurrence rel
Give an initial configuration for Algorithm 7. 7 for which the algorithm actually requires llog NJ + 1 rounds. Determine the set ECR (as defined before Lemma 7. 1 0) for the C
Write algorithm or code segment for locating nth successor of an item in circlar linked list (the nth item that follows the given item in the list).
Compute and report grade-point average for class. Determine the sum of the grades; count number of students; compute average. Determine its algorithm?
Write a class of BST of Employee records (Employee empIDis used as key). The class must contain the following operations:  Search a node (given anemployee's empID), and print
Write a C++ program that creates and populate a tree for an arithmetic expression. Then it should perform an in-order and a post-order traversal on the tree. The input of t