Implement an open hash table

Assignment Help Data Structure & Algorithms
Reference no: EM13412

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

Reference no: EM13412

Questions Cloud

Wind turbine : Wind turbines are becoming more and more common as a method of energy production, wind turbines by their very nature are dynamic and are subject to and create their own internal and external kinematics and kinetics.
Development and growth of amazon : Briefly trace the development and growth of Amazon from 1995 to the present through the application of corporate strategies - what kinds of strategies have these been
Find the annual withdrawal : Find the Annual withdrawal
Explain what is meant by income by ordinary concepts : Advise what tax consequences arise in respect of the payments.
Implement an open hash table : In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.
The Case for Global Accounting Standards : The role of IFRS in both developing and developed capital markets.
Write the structures of the saytzeff elimination : Write the structures of the saytzeff elimination
Portfolio analysis : The stock with the lowest beta (0.76) is Apple Inc. stock. The stock with the highest beta (3.29) is Facebook Inc. stock. Beta for Apple Inc. stock is less that 1, it tells us that stock price is less volatile and risky than mark..
What is blue ocean strategy : What is a 'blue ocean' strategy How does it differ from brainstorming?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd