Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Question Your task for this question is to implement a hash table using an open addressing scheme. This programming question is scaffolded. You are

Programming Question
Your task for this question is to implement a hash table using an open addressing scheme.
This programming question is scaffolded. You are provided with 6 files:
HashTable.java - This class is mostly empty. You are responsible for filling in the insert,
search and delete functions. The constructor which takes in a ProbeSequence which
dictates what hash function is used, and the probe sequence for this hash function.
Record.java - This class is the type of object that is stored in the hash table. This class
should be extended in order to store other data in the hash table.
Student.java - This class extends the Record class.
ProbeSequence.java - contains a function int probe(int i, int key, int m).
Any class that implements this interface must provide such a function which given a key,
an index in the probe sequence and a table size m, returns the hash table index to probe.
MyLinearProbeSequence.java - This implements the ProbeSequence interface and
provides a probe sequence using the multiplication method for the hash function and
linear probing for the probe sequence.
HashTableTest.java - This class shows how to use and test the HashTable class.
Begin by implementing the insert and search functions. The hash table should use a dynamic array such that when an element is inserted and the hash table is already full, the array size is doubled.
Keep in mind that these functions must support arbitrary hash functions and probe
sequences. However, if the probe sequence does not cover all entries in the table, the behaviour is undefined (i.e. don't worry about it).
Note: Assume throughout this question that duplicate keys are not allowed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago