Exercise: Hash Tables

Implement the addSlow() method in LinearHashTable.

We'll cover the following

Task

Implement an addSlow() method for adding an element x to a LinearHashTable, which simply stores x in the first null array entry it finds.

Sample input

100 random elements

Expected output

The expected output will be as follows:

Adding
Searching
The value 96 is not found
The value 88 is not found
The value 62 is found
The value 23 is not found
The value 2 is found
The value 22 is not found
The value 89 is found
The value 61 is not found
The value 50 is not found
The value 4 is not found

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy