bartleby

Concept explainers

Question
Book Icon
Chapter 27, Problem 27.2PE
Program Plan Intro

MyMap using Open Addressing with Quadratic Probing

Program Plan:

  • Define a class named “Sample” to implement MyMap using open addressing with quadratic probing.
    • Define function main.
      • Define an integer HashMap named “map”.
      • Put ‘2, 2” into the map.
      • Remove “2” from the map.
    • Define a static class named “MyHashMap” and implement “MyMap”.
      • Define required variables.
      • Define a function named “MyHashMap”.
        • Construct a map with the default capacity and load factor.
      • Define a function named “MyHashMap” with one parameter.
        • Construct a map with the specific initial capacity and default load factor.
      • Define a function named “MyHashMap” with two parameters.
        • Construct a map with the default capacity and load factor.
      • Define a function named “clear”.
        • Remove all of the entries from this map.
      • Define a function named “containsKey”.
        • Return true if the specified key is in the map.
      • Define a function named “containsValue”.
        • Return true if this map contains the specific value.
      • Define a function named “entrySet”.
        • Return a set of entries in the map.
      • Define a function named “get”.
        • Return the first value that matches the specific key.
      • Define a function named “getAll”.
        • Return all values for the specified key in this map.
      • Define a function named “isEmpty”.
        • Return true if this map contains no entries.
      • Define a function named “keyset”.
        • Return a set consisting of the keys in this map.
      • Define a function named “put”.
        • Add an entry (key, value) into the map and return the value.
      • Define a function named “remove”.
        • Remove the element for the specific key.
      • Define a function named “size”.
        • Return the number of mappings in this map.
      • Define a function named “values”.
        • Return a set consisting of the values in this map.
      • Define a function named “hash”.
        • Return “hashCode % capacity” value.
      • Define a function named “supplmentHash”.
        • Ensure the hashing is evenly distributed and return the result.
      • Define a function named “removeEntries”.
        • Remove all entries from each bucket.
      • Define a function named “rehash”.
        • Rehash this map.
      • Define a function named “toString”.
        • Return a string representing for this map.
    • Define an interface name “MyMap”.
      • Declare function prototypes for the functions which are created at the class “MyHashMap”.

Blurred answer
Students have asked these similar questions
Level-0 Diagram for this: A customer sends in an order form containing details of their order and their membership number.  A check is made to verify that they are a member.  When their order is verified, a check is made to validate that the items ordered are produced by the company.  Next, the valid order is used to update the daily order file, and then used to create a shipping list and invoice, which are sent on to the Order Fulfilment System.
In this assignment, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a clear theme and tell a story. You may pick any school-appropriate theme that you like. The program must include a minimum of: 5 circles 5 polygons 5 line commands 2 for loops 1 global variable You may wish to use the standard code for simplegui graphics below: import simplegui def draw_handler(canvas): frame = simplegui.create_frame('Testing', 600, 600) frame.set_canvas_background("Black") frame.set_draw_handler(draw_handler) frame.start() Submit Your Code After you write your code here in the programming environment, you will check it and submit it as usual. However, the grader will only perform basic checks against some requirements. If your code passes, you should submit your work, and your teacher will manually grade your submitted work using a rubric.
1. What is the difference between a relative cell reference and an absolute cell reference and give an example of when you would use each.

Chapter 27 Solutions

MyLab Programming with Pearson eText -- Access Card -- for Introduction to Java Programming and Data Structures, Comprehensive Version

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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage