Related questions
Given a sequence of 5 keys < 53, 66, 32, 41, 88 > for searching task:
a) Given the hash function H(k) = (3.k) mod 7, insert the keys above according to its original order (from left to right) into a hash table of 7 slots. Indicate the cases of collision. Clearly show the steps and calculation with a table.
b) In case of any collisions found above in a) part, determine the new slot for each collided case using Linear Probing to solve the collision problem. Clearly show your answer for each identified case. No step of calculation required. o (Answer with "NO collision found", in case there is no collisions found above)
c) In case of any collisions found above in a) part, determine the new slot ONLY for the first collided case using Double-Hashing (with functions below) to solve the collision problem. Clearly show the steps of your calculation.
d1 = H(k) = (3.k) mod 7
di = (di−1 + ((5·k) mod 6) + 1) mod 7 , i ≥ 2 o
(Answer with "NO collision found", in case there is no collisions found above)
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images
- Suppose that we are maintaining a table using l inear hashing , with the hash function h(x) = x mod 8. Each block can store up to 3 records. The constraint on the number of buckets is R <= 2.5N, where R is the total number of records in the structure, and N is the number of buckets. Construct the hash structure after the records with the following keys have been inserted: (2, 3, 5, 7, 11, 17, 19, 23, 29, 31) Construct the final structure. Be sure to indicate the value i (the number of hash bits being used), N, and R. Which of the following is true? Group of answer choices Key values 2 and 5 are in the same block. Key value 7 is in a block by itself. Key values 7 and 17 are in the same block. Key values 17, 5, and 29 are in the same block.arrow_forwardIf the sizeof hash table is 11, the hash function is H(key)=(2*key+1)MOD 11,open addressing, square probing. According to the keywords sequence (19,21,10,7,23,32,17,15,11,22), please insert these keywords in the hash table from 0-10 .arrow_forwardA hash-map has been constructed with quadratic-hashing. The hashing function is h(k;) = (3 * k; + 7) mod 17 and the table length is N = 17. How many cells will be probed by the call of insert(2) 1 4 5 6 7 8 10 11 12 13 14 15 16 26 89 11 35 70 59 Note: First row contains the indices and the second row contains the items.arrow_forward
- Which ADT table implementations performs better on the average if the retrieve operation is the major operation of the applications, balanced binary search tree or hash table? Why? Which ADT table implementations is most appropriate if the application requires every single retrieve operation to be done efficiently, balanced binary search tree or hash table? Why? (Think of an emergency system that cannot allow an unpredictable delay from any single retrieval.)arrow_forwardPlease answer all parts of the question, thanksarrow_forwardUsing quadratic probing, what would be the answer for the following questions if you insert the following keys in sequence: 10, 17, 24, 31, 21, 19. (N = 7) While doing the insertions keep track of the number of collisions for each key and get the final configuration of the structure. Use the following quadratic hashing function: ((x mod 7) + j2) mod 7. What is the final configuration of the hash table? Use the indices from 0 to 6 to report where each key will be mapped. If the position has no value use the word empty. For example, if the final configuration is 10,17,24,31,21,19 (starting from index 0), your answer in the box should be 10,17,24,31,21,19,empty. Please don't use blank spaces or quotes to separate the values. Report the number of collisions for each key using the order of insertion. For example, if you answer as 0,1,3,1,0,1, this means that you found 0 collisions for key 3, 1 collision for key 10, 3 collisions for key 17, 1 collision for key 24, 0 collisions...arrow_forward
- Please solve thisarrow_forwardAssume that linear probing is used for hash-tables. To improve the time complexity of the operations performed on the table, a special AVAILABLE object is used to mark a location when an item is removed from the location. Assuming that all keys are positive integers, the following two techniques were suggested instead of marking the location as AVAILABLE: i) When an entry is removed, instead of marking its location in the table as AVAILABLE, indicate the key in the location as the negative value of the removed key (e.g., if the removed key was 16, indicate the key as -16). Searching for an entry with the removed key would then terminate once a negative value of the key is found (instead of continuing to search if AVAILABLE is used). ii) Instead of using AVAILABLE, find a key in the table that should have been placed in the location of the removed entry, then place that key (the entire entry of course) in that location (instead of setting the location as AVAILABLE). The motive is to...arrow_forwardUse the following values to answer the questions bellow: 66 47 87 900 126 140 145 500 177 285 393 395 467 566 620 735 Store the values into a hash table with 25 positions, using key % tableSize as hash function and the linear probing method of resolving collisions. Store the values into a hash table with 25 positions, using double hashing as the method of collision resolution. Use key % tableSize as hash function, and (key + 3) % tableSize as the rehash function. Store the values into a hash table with ten buckets, each containing three slots. If a bucket is full, use the next (sequential) bucket that contains a free slot. Store the values into a hash table that uses the hash function key % 10 to determine into which of ten chains (separate chaining) to put the value.arrow_forward
- Question 15arrow_forward5. Here are keys and their hash values, for hashing using h(k)= k mod m Where m = 13 130 108 K H(K) 9 0 4 Use double hashing to resolve the collision with h2(k)= 10 - (k mod 10) Construct the hash table 100 78 0 35 9arrow_forwardPlease help questions below: How good is the provided hash function--are we really getting constant time operations with our hashmap? Explain. What is one other way you could implement the hash function? Anything creative is acceptable in this answer, but justify how your hashing function works. If I have to resize the hashmap to add more buckets, what is th Big-O complexity when you resize? (Explain why) What is 'open addressing' in regards to hash maps and hash tables?arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education