Answered step by step
Verified Expert Solution
Question
1 Approved Answer
After completing this assignment, you will be able to: Use an algorithmic planning document to plan your ADT Create test cases to test the ADT
After completing this assignment, you will be able to:
Use an algorithmic planning document to plan your ADT
Create test cases to test the ADT
Write a class to represent a Table ADT using a hash table as the data structure
Write a client tester menudriven program to test your ADT
Requirements
Computer science vocabulary is important with moving on to the next level of courses. For this assignment, you will build a dictionary to store computer science terms and definitions.
ADT requirements
Table Implementation Dictionary:
Use a hash table for storing data in the dictionary. Make sure your hash tables size is a prime number. The search key will be the name of the computer science term.
The ADT will contain the following functions:
Constructor is passed the size of the table and dynamically allocates the table. For this, you will need to use a pointer to a pointer, table is a pointer to Node pointers:
Node table new Nodesize;
Hash function generates a hash code based on the computer science term
Add term is passed a term and a description. Do not add duplicate terms; if the term is a duplicate, return a flag and print a message in the client program
Display definition is passed a term and displays the definition if it exists
Display dictionary displays the terms stored in the hash table, print each index, and then the words stored in the chain on that index, for example:
Index :
Index :
Index : hash tablefunction
Index : modulus
Remove computer science term is passed a term and removes the node, if it exists. Return a flag and print a message in the client program if the term does not exist.
Destructor
Experiment with different table sizes and hash algorithms. Try using a table size with a power of instead of a prime number. How does that affect the distribution of your data?
Input file:
Create an input text file and add at least computer science terms and definitions.
Use only terms youve used in CS CS and CS
Your file should be of the format:
termdefinition
Client requirements
Read from the text file the terms and definitions to populate the hash table. After your text file has been approved, I recommend combining a few files from other students to create a LARGE dataset.
Create a menu system that allows the user to:
Add new terms to the dictionary print a message if the term was successfully added or if the term case insensitive already exists
Search for a term and print the definition
Display the hash table
Remove a term from the dictionary
Instructions
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started