Question

Java Implement one of the hashing procedures that we have discussed, and the following related functions:...

Java

Implement one of the hashing procedures that we have discussed, and the following related functions:

  • INSERT (item)
  • DELETE (item)
  • FIND (item)

Make sure that your program correctly handles collisions and full hash table!

Homework Answers

Answer #1
import java.util.*;

class hashSetEg {
        public static void main(String args[]) {
                HashSet<String> set = new HashSet<>();

                //Insert elements into Hashset
                set.add("John");
                set.add("Alex");
                set.add("Alice");
                set.add("Bob");
                set.add("Smith");
                System.out.println("Set is- "+set);


                //Delete element from Hashset
                set.remove("Alice");
                System.out.println("After delete the element set is- "+set);

                //Find the element from Hashset
                if(set.contains("Bob")) {
                        System.out.println("Finded!");
                }


        }
}
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I NEED A JAVA PROGRAM TO IMPLEMENT THE CONCEPT OF INDEX, if we have an DB...
I NEED A JAVA PROGRAM TO IMPLEMENT THE CONCEPT OF INDEX, if we have an DB file has a records of students number and names like this (Student file) stNum**stName 1 jack 2 maya 3 sam 4 alex 5 jane . . . . . . this file may have a thousands records, if we want to search for a specific record(student), we need to find it by (Index file), in this index file we have this (Index file) stNum**Address...
Using Java: implement a program with the following features. Thanks Produce a menu for the user...
Using Java: implement a program with the following features. Thanks Produce a menu for the user with 3 choices. Add a new user Attempt login See all users If the user chooses #1, prompt them for a username (a string). Then a password (a string). Using SHA-2 hash the password they gave you, and store the resulting username and hashed password in a datastructure of your choice. (It can be 2 arrays, one for usernames, one for hashed passwords). If...
Given the following specifications for an array-based unsorted list, implement all of the functions (declared below)...
Given the following specifications for an array-based unsorted list, implement all of the functions (declared below) and a write a driver code to test all of your implementations. // Define a structure to use as the list item struct ListItem { int key; int Data; }; #define MAX_SIZE 50 // Define maximum length of the list class UnsortedArray { private: int head; // Index to head of the list ListItem theList[MAX_SIZE]; // The list public: UnsortedArray(); // Class constructor ~...
JAVA: Design and implement a recursive version of a binary search.  Instead of using a loop to...
JAVA: Design and implement a recursive version of a binary search.  Instead of using a loop to repeatedly check for the target value, use calls to a recursive method to check one value at a time.  If the value is not the target, refine the search space and call the method again.  The name to search for is entered by the user, as is the indexes that define the range of viable candidates can be entered by the user (that are passed to...
This semester we have discussed the following statistical analyses.               Z-test               One-Sample
This semester we have discussed the following statistical analyses.               Z-test               One-Sample t-test                    Independent Groups t-test                   Repeated Measures t-test One-Way ANOVA                 Repeated Measures ANOVA             Correlation Fill in the table with the correct defining term. ? is given µ is given Groups Compared Test Used No No Looks at the same group at 2 different times or across two different conditions Yes Yes Sample against population X X Examines the degree to which two variables relate to one another...
C PROGRAMMING Doubly Linked List For this program you’ll implement a doubly linked list of strings....
C PROGRAMMING Doubly Linked List For this program you’ll implement a doubly linked list of strings. You must base your code on the doubly linked list implementation given in my Week 8 slides. Change the code so that instead of an ‘int’ each node stores a string (choose a suitable size). Each node should also have a next node pointer, and previous node pointer. Then write functions to implement the following linked list operations: • A printList function that prints...
Design a pseudocode program that loads an array with the following 7 values. Add one more...
Design a pseudocode program that loads an array with the following 7 values. Add one more word (of your own choosing) for a total of 8 words. biffcomelyfezmottleperukebedraggledquisling Be sure to use lowercase, as shown above. This will make the processing easier. • Ask the user to enter a word • Search through this array until you find a match with the word the user entered. • Once you find a match, output "Yes, that word is in the dictionary"....
Problem: A non-linear system consists of two functions: Complete the following three parts. Make a table...
Problem: A non-linear system consists of two functions: Complete the following three parts. Make a table of values for the functions. The table can be similar to the one below, or it can be vertical, but it must have a minimum of five x-values and the corresponding function values. Using your table indicate the solution to the system by marking the function values that are equal. x f(x) g(x) Plot a graph of the functions over an interval sufficient to...
You have one Question, Which have four parts, 1st... PHP scriptIn a HTML document, use PHP...
You have one Question, Which have four parts, 1st... PHP scriptIn a HTML document, use PHP to obtain the following :The user will write a sentence as a value of a predefined variable.The output should look like this :The sentence you entered is :This is my sentenceIt is composed of :• 4 different words• 19 characters (including spaces)Note : Your program should make sure the final output is in lower case with the first letter in upper case. 2nd... PHP...
We have been using the same set of data (Data Set One) in the notes to...
We have been using the same set of data (Data Set One) in the notes to illustrate production and costs. I have provided Data Set One in both tables below. When costs were calculated in the notes, fixed costs were $200. By using the term fixed costs economists are only referring to the fact that a firm must pay this expense no matter how much output it produces or sells. An example of a fixed cost could be the rent...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT