Question: Please guys help me understand this assighnment task by task! In Java progarmming language thank you! Today, you will learn about a different data structure.

Please guys help me understand this assighnment task by task! In Java progarmming language

thank you!

Please guys help me understand this assighnment task by task! In Javaprogarmming language thank you! Today, you will learn about a different data

Today, you will learn about a different data structure. You've seen the HashMap and the HashSet. The "hash" in HashMap and HashSet refers to a data structure known as the hash table You will implement the following inerface. The methods are described in the tasks below. public interface HTableKE> public void add (E element) public boolean contains (Object o)i public void print Task 1: So...hash table. What's up with that? You are familiar with arrays. You are familiar with linked lists. Some of you prefer arrays while others prefer linked lists. Well, today everyone will be happy! Hash tables bring together the best of both worlds. A hash table is an array of... wait for it..linked lists! I am not making this up. A hash table is actually an array and each array element is a linked list. Data structures just don't get more awesome than this. Ready? Off we go... Create a class named Hashtable, where E is the type of object that will be stored in the hash table. This class will implement the HTable interface given above. Task 2: Setting up the Hashtable class: The field for the class is an array of linked lists. You may use Java's LinkedList class for this lab (import java.util.LinkedList). This makes the type of the array LinkedList0 The constructor must create this array of linked lists. This is a two step process. First, you create the array (let's say of size 15). To make this as fun as possible, Java does not allow generic array creation. To get around this, create an array of type LinkedList[] and then employ type casting. Remember that creating an array just creates an array of empty boxes. No actual linked lists are created. The second step is to then traverse the array and set each array element equal to a brand new linked list. Naturally, all the linked lists are empty at this point. You should have two constructors: a default constructor and one that allows the array capacity to be specified as a parameter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!