• Can I use hash key as an id? Specify the reason.
• How do you handle the duplication of the hash code?
• How do you deal with a shared hash table being used on the web server?
1. Hash key can be used as id but is not recommended. But the hash function used should be collision resistant. A collision occurs when for two different values the computed hash is the same. The number of hash collisions for a given data set depends on the hash function used. Usually, hash functions with an extremely large hash key are collision-resistant as it is more difficult to obtain the same value for such a large key. For example, the most widely used cryptographic algorithm SHA-256 uses 256 bits hash key making it more collision resistant then SHA-1 and MD5.
Also, being collision resistant does not mean that the collisions cannot happen. It means that the collisions are hard to find. Many cryptographic algorithms which were initially described as collision resistant were broken later on.
2. If we specifically talk about duplication of hash codes in Java then we have two methods hashcode() and equals(). Basically, if two objects are equal then their hash codes should be equal. If the objects are not explicitly overridden then two objects are equal if and only if they are the same object which is created by a new call. It is called reference equality.
Now if we talk about maps in Java, each map key can have only one value. If a new entry is entered then the previous key-value pair is replaced by the new place. The map computes the hash code of the new key if the hash code does not already exist then it's value is simply entered but if the hashcode is already present then it looks for all entries with equal hashcodes and compares them to the new key using equals and it overrides the existing first key, if found.
In general, how useful is the Dictionary/Hash Table data structure? Can you think of other uses aside from those? If we didn’t have the Dictionary/Hash Table data structure can you think of another way to implement the dictionary concept? Can the Dictionary/Hash Table ADT accept/handle null key entries? What about null values? Why or why not? Given these behaviors, what conclusions can you draw about tuning a hash table for different data sets?
Which of the following directives do you use to specify the default location for all Web site files hosted by Apache Web server? ServerRoot ApacheRoot DocumentRoot ResourceConfig AccessConfig PreviousNext
Cryptographic hash functions are very commonly used in password verification. For example, when you use any online website which requires a user login, you enter your E-mail and password to authenticate that the account you are trying to use belongs to you. When the password is entered, a hash of the password is computed which is then sent to the server for verification of the password. The passwords stored on the server are actually computed hash values of the original...
Java using data structures The objective is to create your own Hash Table class to hold a list of employees and their ID numbers. I've provided the TableEntry class which will be each data object in the hash table. The list of employees will be provided as a .txt file and must be read with the code. please create a .txt file called Employees.txt with the info provided so that the java code can read it in. Employees.txt: (No WhiteSpace...
IN JAVA USING ECLIPSE The objective of this assignment is to create your own hash table class to hold employees and their ID numbers. You'll create an employee class to hold each person's key (id number) and value (name). Flow of the main program: Create an instance of your hash table class in your main method. Read in the Employees.txt file and store the names and ID numbers into Employee objects and store those in your hash table using the...
PROGRAM DESCRIPTION Implement a hash table class. Your hash table should resolve collisions by chaining and use the multiplication method to generate hash keys. You may use your own linked list code from a previous assignment or you can use a standard sequence container. Partial definitions for the hash table class and a generic data class are provided (C++ and Java versions). You may use them as a starting point if you wish. If you choose to design your own...
Problem 2 Assume that you want to design a hashtable to store data of employees in a company. The ID of each worker is his primary phone number in the form of 10 digit number (Area code-three digits carrier-4 digits id), Knowing the following constraints (information). a) Employees can differ only on the three low significant digits, the fifth and the sixth digits; they all have the same digits for the fourth, seventh, eighth, ninth and tenth digit. b) No...
2. (10 points.) The procedure HASH-SEARCH takes a hash table T[O : m-1) and a key k as its parameters. Each element of T is either a key or NIL. The procedure searches for k in T by probing. If it finds k, then it returns the index j where k appears in T. If it cannot find k, then it returns -1. (A procedure very much like HASH-SEARCH is discussed on pages 269–274 of Cormen.) HASH-SEARCH(T, k) i= 0...
This should be in Java Create a simple hash table You should use an array for the hash table, start with a size of 5 and when you get to 80% capacity double the size of your array each time. You should create a class to hold the data, which will be a key, value pair You should use an integer for you key, and a String for your value. For this lab assignment, we will keep it simple Use...
CAN YOU PLEASE EXPLAIN IN TASK 3 - HOW DO WE REPRESENT
TOTAL PARTICIPATION AND KEY CONSTRAINTS IN SQL CODE. PLEASE PROVIDE
SOLUTION AND DETAILED EXPLANATION.
I WOULD REALLY APPRECIATE IF YOU CAN HELP ME WITH THE
ABOVE 2 QUESTIONS.
I WILL DEFINITELY RATE!!
Thank you.
Task 2 [40 points Given an ER diagram (as shown below), write SQL statements to create the corresponding relations and capture as many of the constraints as possible. If you cannot capture some constraints,...