Creating a Generic Hash Table using Advanced C++

Creating a Generic Hash Table using Advanced C++ Coding The goal of this assignment is to give you practice in function and class templates and applying other concepts covered in the course.

Creating a Generic Hash Table using Advanced C++
Creating a Generic Hash Table using Advanced C++

You are to create a generic (class template) hash table. You will use this template to create a “Dictionary” of words. The words will be stored in a (library) class type that you will derive from a string. You will use your hash table Dictionary to spell check a document and perform some analysis of the efficiency of your hash table.

PROGRAM STEPS

Derive a class from string, call Mystring. You will use this class to store words from the Dictionary file. The class should contain necessary constructors, a conversion operator to convert Mystrings to unsigned int, a tolower function to convert the letters in a word to lower case, and a removePunctuation function to strip off non-alphabetic characters from both ends of the word. This class should be tested and then placed in a library.

Create a generic linked list. Do this by creating a Node and List class template. You will use this by instantiating a template class of type Mystring.

Create a hash-table class template, called Myhash. You may use the hash function shown below for your hashing algorithm. To resolve “collisions” in your hash table, use “chaining” implemented with your generic linked list from the previous step. You will instantiate your hash table class template to create a template class of Mystring. The Myhash class template should have size, insert and find member functions and member functions necessary to produce the 3 statistics shown in the output below (percent of buckets used, average bucket size, and largest bucket size). The Myhash insert function should throw a DuplicateError exception when a duplicate Mystring is attempted to be inserted into the Myhash template class object (the dictionary).

Create a DuplicateError class template, derived from the logic_error standard exception. This class template will be instantiated to create a template class of my string.

Run the code found in the suggested main function below. Your output should identify duplicate words (type Mystring) that were attempted to insert into the Dictionary, the number of words in the Dictionary, the hash-table bucket statistics (shown in the sample output), and misspelled words (plus total).

Unlike most other websites we deliver what we promise;

  • Our Support Staff are online 24/7
  • Our Writers are available 24/7
  • Most Urgent order is delivered with 6 Hrs
  • 100% Original Assignment Plagiarism report can be sent to you upon request.

GET 15 % DISCOUNT TODAY use the discount code PAPER15 at the order form.

Type of paper Academic level Subject area
Number of pages Paper urgency Cost per page:
 Total: