Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
IN C++
Perform a comparative analysis that studies the collision rates for various hash codes for character strings, such as various polynomial hash codes for different values of the parameter a. Use a hash table to determine collisions, but only count collisions where different strings map to the same hash code (not if they map to the same location in this hash table). Test these hash codes on text files found on the Internet. Use 37, 40, and 41 for parameter a. IN C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- I am trying to implement a hash table of key-value pairs, where the key determines the location of the pair in the hash table, the key is what the hash function is used on. The hash table that I am trying to implement will use separate chaining (with unordered linked lists) for collision resolution. I need help changing the code where: 1. The "search" method of the code returns the node that was found or "None" 2. The "Node" implementation has a "key" and "value" member This is what I have so far class Node: def __init__(self,initdata): self.data = initdata self.next = None def getData(self): return self.data def getNext(self): return self.next def setData(self,newdata): self.data = newdata def setNext(self,newnext): self.next = newnext class UnorderedList: def __init__(self): self.head = None def isEmpty(self): return self.head == None def add(self,item): temp = Node(item) temp.setNext(self.head)…arrow_forwardANSWER ALL QUESTIONSarrow_forwardTask - 1: Write a java program to implement the following algorithms for Open Addressing techniques for Hash Table data structure. (Use a simple array of integers to store integer key values only). HASH-SEARCH(T, k) HASH-INSERT (T, k) i = 0 repeat j = h (k, i) if T[j] == NIL T[j] = k return j else i = i + 1 ● i = 0 repeat until i == m error “hash table overflow" For both algorithms, to compute the index j, write the following methods: getLinear ProbIndex (key, i) getQuadraticProbIndex ● get DoubleHash (key, i) (key, i) j = h (k, i) if T[j] == k return j i = i + 1 until T[j] == NIL or i = m return NIL Linear Probing index is computed using following hash function: h(k, i) = (h₁(k) + i) mod m h₁(k)= k mod m Quadratic probing index is computed using following hash function: h(k, i) = (h₁(k) + i²) mod m h₁(k)= k mod m Double hashing index is computed using following hash function: h(k, i) = (h₁(k) + i h₂(k)) mod m h₁(k)= k mod m h₂(k) = 1 + (k mod m - 1)arrow_forward
- We're dealing with a bad hash map in which all of the values are stored in the same container (that is, they are all in the same LinkedList). The purpose of a hash map has been completed.arrow_forwardWrite a C++ program that: (1) defines and implements a hash class that constructs a 15 element array (may be implemented using a vector, a deque, or a list, if you prefer), storing strings, using the following hash function: ((first_letter) + (second_letter) + (last_letter))% 15 (2) the driver program should: a. query the user for ten words and store them using the hash technique described above. b. print out the contents of each position of the array (or vector, deque, or whatever you used), showing vacant as well as filled positions. Remember, only 10 of the 15 positions will be filled. c. repeatedly query the user for a target word, hash the word, check for its inclusion in the list of stored words, and report the result. Continue doing this task until the user signals to stop (establish a sentinel condition).arrow_forwardin 20 minarrow_forward
- Write the lines of code to insert the key (book's ISBN) and value ("book") pair into "my_hash_table".arrow_forwardc++arrow_forwardjava Draw a picture of the HashSet created by the data shown below. Assume the HashSet (1) has an initial size of 11, (2) uses separate chaining, and (3) inserts new nodes at the start (not end) of the chain. -4, 2, 18, 23, -15, 47, 87, 2032, 5393, 2, 53432arrow_forward
- do botharrow_forwardCreate a new concrete class that implements MyMap using open addressing with linear probing. For simplicity, use f(key) = key % size as the hash function, where size is the hash-table size. Initially, the hash-table size is 4. The table size is doubled whenever the load factor exceeds the threshold (0.5). Test your new MyHashMap class using the code at https://liveexample.pearsoncmg.com/test/Exercise27_01.txt Class Name: Exercise27_01 If you get a logical or runtime error, please refer https://liveexample.pearsoncmg.com/faq.html MyHashMap.java located here https://liveexample.pearsoncmg.com/html/MyHashMap.html? MyMap.java located here https://liveexample.pearsoncmg.com/html/MyMap.html IMPORTANT Please do not take answers from Chegg or the rest of the internet, they are all wrong (I checked them). Please only provide a solution if you know the answer. I need to submit the code to Revel, I do not need the entire code, I need to submit the code enclosed between // BEGIN…arrow_forwardfast please c++ Insert the elements of A in hash table H of size 10. H is a vector of int is size 10. Do not allow duplicates. Draw the table. The hash function is the number itself; f(n) = n%10arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education