Description
Description
One of the challenges in programs is to store data in a structure that allows fast and efficient searching. Hash tables provide this type of performance by storing data in buckets based on a value called a hash key. The bucket containing a specific data entry is identified by a hash key, which is generated by a hash function. Finding a data entry is then a simple matter of taking a hash key, determining which hash table bucket contains that key value, and then sequentially searching a relatively small linked list in the appropriate hash table bucket. Think of the entire hash table as a list full of small linked lists that are each identified by a value calculated by a hash function that takes a key value as input and returns a bucket identifier.
For this assignment, you will complete the following:
- Create a flowchart to demonstrate the operation of a hash structure. This flowchart should include operations to insert and remove entries in the hash structure.
- Create a flowchart to demonstrate the operation of the hash function (the hash key generator).
- Write a complete Java program to implement a hash table data structure for String data.
- Your program should demonstrate insertion and removal of data.
- A linked list must be used in the hash buckets to resolve duplicate data collisions.
- Note: You may not use the Java HashTable or HashMap or other similar built-in Java data structures for your solution. The intention of this assignment is for you to demonstrate your ability to write the code for your own hash table functionality.
- Submit your flowcharts and Java source code in a single MS Word document for grading.
Explanation & Answer
Attached.
Running head: DATA STRUCTURE HASHTABLE
Data structures hashtable
Course number and name
Student name
Date
1
DATA STRUCTURE HASHTABLE
Flowchart
INSERT operation in HashTable
2
DATA STRUCTURE HASHTABLE
REMOVE operation in HashTable
3
DATA STRUCTURE HASHTABLE
Operation of the hash function
4
DATA STRUCTURE HASHTABLE
JAVA Code
/* Node for linked list */
class LinkNode {
LinkNode next;
int data;
/* Constructor */
public LinkNode(int x) {
data = x;
next = null;
}
}
class HashTableLinkedList {
private LinkNode[] hashtable;
private int size;
/*...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
One Flew Over the Cuckoos Nest
by Ken Kesey
2001 A Space Odyssey
by Arthur Clarke
East of Eden
by John Steinback
The Age of Innocence
by Edith Wharton
Gone with the Wind
by Margaret Mitchell
The Call of the Wild
by Jack London
The Great Gatsby
by Francis Scott Key Fitzgerald
Too Much and Never Enough
by Mary L. Trump
Anthem
by Ayn Rand