Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 27, Problem 27.6PE
Program Plan Intro
Animation of linear probing
Program plan:
- Import the required package.
- Create the class “Ex27_06”.
- In the main() function,
- Create the buttons to perform insert, delete and search operations.
- Create the vertical and horizontal box to add the entries.
- Make the alignment of the pane.
- Set the title and scene for the animation.
- For each button raise the event through ActionListener interface.
- Create the class Hashview,
- Set the table size to set the hash values.
- Create a class MyHashMap,
- Define the constructor MyHashMap() to construct the map with the specified initial capacity and load factor.
- Define the method clear() to remove the entries from map.
- Define the method containsKey() to check and return the Boolean value True if the specified key is in the map.
- Define the method containsValue() to return true if specific value is found.
- Define the method isEmpty() to return true if the map contains no entries.
- Define the method put() to add the entry into map.
- Define the method remove() to remove the entries from map.
- Define the method rehash() to rehash the map values.
- Declare the static interface.
- Declare the method clear() to clear the entries of the map.
- Declare the method containsKey() and it returns true if the value is present in the amp.
- Declare the method containsValue() to return true if specific value is found.
- Define the method get() to return the first value of the map.
- Define the method put() to put the entries in the map.
- Define the method size() to return the number of mappings in the map.
- Define the method Entry() to enter the value of element.
- Define the method getKey() to return the value.
- Define the method toString() to represent the string value of key.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
- In class HashTable implement a hash table and consider the following:(i) Keys are integers (therefore also negative!) and should be stored in the tableint[] data.(ii) As a hash function take h(x) = (x · 701) mod 2000. The size of the table istherefore 2000. Be careful when computing the index of a negative key. Forexample, the index of the key x = −10 ish(−10) = (−7010) mod 2000 = (2000(−4) + 990) mod 2000 = 990.Hence, indices should be non-negative integers between 0 and 1999!(iii) Implement insert, which takes an integer and inserts it into a table. Themethod returns true, if the insertion is successful. If an element is already inthe table, the function insert should return false.(iv) Implement search, which takes an integer and finds it in the table. The methodreturns true, if the search is successful and false otherwise.(v) Implement delete, which takes an integer and deletes it form the table. Themethod returns true, if the deletion is successful and false otherwise.(vi)…
2) Hash Innards
Homework • Unanswered
Select all true statements from the below.
Multiple answers: Multiple answers are accepted for this question
Select one or more answers and submit. For keyboard navigation. SHOW MORE V
a
A hash function takes a key and produces an index into the hash table.
The next step in this process is often something like 'h%SIZE' so that the hash value of the key will fit within the table
b
(having SIZE elements, you see).
Common techniques involve exclusive or of bits within the key and folding different sections of bits within the key into
each other.
The best hash method for character strings is to simply add up the ASCIlI values of their individual characters.
Coming up with a perfect hash for a given set of keys can be a difficult and time-consuming task.
I need help urgently to be able to understand how to do this program it is written in C++ but I am currently lost as to how I should start or do it or what is it even asking I would highly appreciate any good help
Chapter 27 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Ch. 27.2 - Prob. 27.2.1CPCh. 27.3 - Prob. 27.3.1CPCh. 27.3 - Prob. 27.3.2CPCh. 27.3 - Prob. 27.3.3CPCh. 27.3 - Prob. 27.3.4CPCh. 27.3 - Prob. 27.3.5CPCh. 27.3 - Prob. 27.3.6CPCh. 27.3 - If N is an integer power of the power of 2, is N /...Ch. 27.3 - Prob. 27.3.8CPCh. 27.3 - Prob. 27.3.9CP
Ch. 27.4 - Prob. 27.4.1CPCh. 27.4 - Prob. 27.4.2CPCh. 27.4 - Prob. 27.4.3CPCh. 27.4 - Prob. 27.4.4CPCh. 27.4 - Prob. 27.4.5CPCh. 27.4 - Prob. 27.4.6CPCh. 27.5 - Prob. 27.5.1CPCh. 27.6 - Prob. 27.6.1CPCh. 27.6 - Prob. 27.6.2CPCh. 27.6 - Prob. 27.6.3CPCh. 27.7 - Prob. 27.7.1CPCh. 27.7 - What are the integers resulted from 32 1, 32 2,...Ch. 27.7 - Prob. 27.7.3CPCh. 27.7 - Describe how the put(key, value) method is...Ch. 27.7 - Prob. 27.7.5CPCh. 27.7 - Show the output of the following code:...Ch. 27.7 - If x is a negative int value, will x (N 1) be...Ch. 27.8 - Prob. 27.8.1CPCh. 27.8 - Prob. 27.8.2CPCh. 27.8 - Can lines 100103 in Listing 27.4 be removed?Ch. 27.8 - Prob. 27.8.4CPCh. 27 - Prob. 27.1PECh. 27 - Prob. 27.2PECh. 27 - (Modify MyHashMap with duplicate keys) Modify...Ch. 27 - Prob. 27.6PECh. 27 - Prob. 27.7PECh. 27 - Prob. 27.8PECh. 27 - Prob. 27.10PECh. 27 - Prob. 27.11PECh. 27 - (setToList) Write the following method that...Ch. 27 - (The Date class) Design a class named Date that...Ch. 27 - (The Point class) Design a class named Point that...
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
- All of these statements are related to hash function, hash table.arrow_forwarddo botharrow_forwardWrite a function that is passed an array of numbers and returns a hash table containing the minimum, maximum and average value. @{min=????; max-???; average=???} Test by passing the function 3 different arrays of randomly generated numbers. If the array is empty set all 3 values to zero. (3)arrow_forward
- Implement the following Racket functions: You must use recursion, and not iteration. You may not use side-effects (e.g. set!). Transitive? Input: a list of pairs, L. Interpreting L as a binary relation, Transitive? returns #t if L is a transitive relation and #f otherwise. Examples: (display "Transitive? \n") (Transitive? '((a b) (b c) (a c))) ---> #t (Transitive? '((a a) (b b) (c c))) ---> #t (Transitive? '((a b) (b a))) ---> #f (Transitive? '((a b) (b a) (a a))) ---> #f (Transitive? '((a b) (b a) (a a) (b b))) ---> #t (Transitive? '())---> #tarrow_forwardC++arrow_forward2. a) Why is Hashing preferred over other method of searching? b) Explain the differences between open hashing and closed hashing. What are the advantages and disadvantages for each of them. c) Given the following keys: 55, 64, 37, 100 and 25 Using the hash function, h(k)= int (M * frac(k * A)) Where frac(x) = fractional part of the number x, for example frac(3.567) = 0.567) M is the size of the hash table and is given as 13 A = constant = 0.35784 (given) For accuracy, you must keep as many digits possible in the fraction, don't round it up. Compute the Hash Values using the above function. Is there any collision?arrow_forward
- Need help with this computer scinece questionarrow_forward3. Write findMaxR(self, root) that will return the maximum of a BST using recursion. 4. Write find MinR(self, root) that will return the minimum of a BST using recursion.arrow_forwardPlease help me with this using java and recursion. Please also comment the code. Please do not use hashtags when creating theses fractals. And provide an image of the output. (Just pick one) 1) create a sierpenski triangle fract 2) create a viscek fractalsarrow_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