Describe the behavior of the java class

Assignment Help JAVA Programming
Reference no: EM13890892

Project: Complete exercise C-10.40 on p. 454 in the textbook. Read the problem statement carefully. The authors initially describe the behavior of the java.util.Hashmap class. As they describe it, the Java implementation of a Hash Map consists of a table (bucket array) of entries. Each entry consists of a K, V pair with the addition of a next reference that refers to a next entry in the bucket. In that way, if collisions have occurred and multiple entries/keys hash to the same bucket, they will be arranged in a singly linked list.

Data Structure Classes: Your job is to modify the ChainHashMap class of the textbook to exhibit the same behavior. You will be modifying the source code of the author's classes - so the first step will be to copy those files to your eclipse package. At a minimum I would recommend these:

1. Map.java

2. AbstractMapjava

3. UnsortedTableMap ava

4. AbstractHashMap.java

5. ChainHashMap.java

6. Entry.java

You can approach your solution in one of several different ways.

Some approaches might be:

1) modify Entry to include the extra field for the next reference. The method findIndex will need to utilize a hash value to find the appropriate bucket. Methods bucketGet and bucketPut will need to walk through the list as necessary looking for a key match.

or 2)instead of modifying Entry, modify UnsortedTableMap to create an array list of singly linked lists. Other methods will have to be modified as well to adapt the methods of the list class.

Test Driver: You will need to create a test driver. Create an implementation of Code Fragment 10.2, p. 405 in the textbook. Rather than reading from System.in, do file I/O with Java.

File Data and Name: In order to generate test data, you must use my file named ‘system.txt' that is in the Blackboard Information content area. You can ‘hard code' this name into your program - or better yet, pass the file name as a command line argument and read that within the test driver. And you might have to play around with ‘where' to put the file. Eclipse and Java don't necessarily look in the directory containing the code, but the directory above.

Reference no: EM13890892

Questions Cloud

Propose at least three control measures : Propose at least three control measures that organizations need to put in place to ensure that they remain complaint   With emerging technologies and in a continually changing IT environment.
Develop a use case diagram for renting acar : Develop a use case diagram for renting acar. Include actors representing a fleet mechanic, a rental agent, and acustomer, and use cases for  reportMechanicalProblems(),  orderRepairs(),  makeRepairs(),  makeReservation(),  rentCar(), andreturnCar().
Describe an important problem faced by society today : Describe an important problem faced by society today. Provide your own analysis of the problem in terms of each of the elements of thought as defined by Paul and Elder.
Do that masculinity and femininity are social constructs : Do you think that masculinity and femininity are social constructs, or are they biologically/genetically determined?
Describe the behavior of the java class : The authors initially describe the behavior of the java.util.Hashmap class. As they describe it, the Java implementation of a Hash Map consists of a table (bucket array) of entries. Each entry consists of a K, V pair with the addition of a next re..
Assignment in programming java : Assignment in programming (java). How to do the assignment at all. Some guidance on some steps to follow even maybe would help. I'm having a pretty hard time in the class being that I've never programmed prior to taking the course. I get the basic pi..
Calculate dells roe for the years ended february : Calculate Dell's ROE for the years ended February 3, 2012, and January 28, 2011. Round your ratio answers to two decimal places, and your percentage answers to one decimal place.
Determines the level of solar uv-b radiation : What determines the level of solar UV-B radiation at a specific place
Subscription revenue for the amounts received : a. Tao Co. receives $10,000 cash in advance for 4 months of legal services on October 1, 2013, and records it by debiting Cash and crediting Unearned Revenue both for $10,000.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a new class called dwelling

1 Create a new class called Dwelling that includes the functionality below 2.    The new class has the attributes of: category - dwelling's category (i.e.:"House", "Condo", "Apartment","shach",etc.), type String numberOfBedrooms - the number of bedro..

  What are the merits and demerits of the use of mainframes

write a 200- to 300-word short-answer response to the followingwhat are the advantages and disadvantages of the use of

  Write down an applet which displays a 4x4 grid when the

write an applet that displays a 4x4 grid. when the user clicks on a square in the grid the applet should draw a filled

  Write a java class that reads through a text file

You will write a Java class that reads through a text file of drawing commands and draws the appropriate shapes onto JFrames

  Create an application that provides a solution

Create an application that provides a solution for problem 20.8 In addition to requirements specified in the description.

  Create a program that does runtime performance

Create a program that does runtime performance analysis of ArrayLists, TreeSets and HashSets.Add 100,000 random random integers ( 0 - 1,000,000 )Attempt to remove 10,000 random integers ( 0 - 1,000,000 )

  Simulate a simple multiuser computer system

Prepare a java program to simulate a simple multiuser computer system

  Write java application that effectively uses java collection

Write a Java application that effectively uses Java collections to store up to 20 instances of the Person class and its subclasses. Then write a GUI that displays the Person names using radio buttons to select a value

  Constructing a simple flowchart that describes simple logic

Constructing a simple flowchart that describes simple logic flow through a program. Translating the flowchart into pseudo code. Creating a simple module, based on the pseudo code created in step 2, which accepts a parameter and returns a value.

  Write function in javascript to compute person-s gross pay

Write the function using JavaScript syntax to compute a person's gross pay for a week. The function should receive the number of hours worked and the rate of pay per hour.

  Java application that reads a date in numeric form

Designand write a java application that reads a date in numeric form from a set of three fields and displays it in English within a label. Use appropriate buttons. For Example:

  Palindrome is a sequence of char that reads backward forwrd

A palindrome is a sequence of characters that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554, and 11611. Write an application called Palindrome.java that asks the user t..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd