Introduction to Java Programming and Data Structures, Comprehensive Version Plus MyProgrammingLab with Pearson EText -- Access Card Package
bartleby

Concept explainers

Question
Book Icon
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.

Blurred answer
Students have asked these similar questions
A. We have decided to change the type of hashing we use to a newer version that is collision resistant. What happens when a hash collision occurs? You can figure out the plain text from the hash. When two different plaintexts produce the same hash. The same plain text produces two different hashes using the same hash function. A variable-length text produces a fixed-length hash. B.“Alice” and “Bob” are talking about hashing and they use the abbreviation MAC. What are they talking about? Message Authentication Code. Media Access Control. Mandatory Access Control. Message Access Code. C.Which one of the following is not one of the basic requirements for a cryptographic hash function? The function must be collision free. The function must work on fixed-length input. The function must be relatively easy to compute for any input. The function must be one way. D.Bob wants to produce a message digest of a 2,048-byte message he plans to send to Alice. If he uses the SHA-1 hashing…
Class HashTable: Implement a hash table to store integers (including negative ones).  stored in the table int[] data. Use the hash function:  h(x) = (x · 701) mod 2000.  The table size is 2000. Ensure non-negative indices between 0 and 1999. Implement the following methods: insert(int key): Inserts the integer into the table. Returns true if successful, false if the element is already in the table. search(int key): Searches for the integer in the table. Returns true if found, false otherwise. delete(int key): Deletes the integer from the table. Returns true if successful, false otherwise. Class HashTable2: Implement a second hash table using a different hash function and collision resolution strategy. Keys are integers (including negative ones). Use the hash function: ℎ(�)=(�⋅53)mod  100h(x)=(x⋅53)mod100. The table size is 100. Ensure non-negative indices between 0 and 99. Implement the following methods: insert(int key): Inserts the integer into the table. Returns true if…
Implement a resize function for a hash table. Resizing is the process of increasing a hash table's size when too many items have been added, reducing the hash table's effectiveness. To resize the hash table, increase the size of the table by some small factor (not less than 2x), remove everything from the old table, and insert it into the new larger table. Make sure to free up memory that is no longer used after resizing. Use the following heuristics to resize the table: • When the load factor exceeds .5. If no entry is found within the probe distance. Note, you may need to change insert as well to have a fully working solution.

Chapter 27 Solutions

Introduction to Java Programming and Data Structures, Comprehensive Version Plus MyProgrammingLab with Pearson EText -- Access Card Package

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education