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 class called bankaccount

For your new program (#5 above), create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two constructors, as follows:

  Write an if statement that uses the flag as the condition

Write an if statement that uses the flag as the condition. Remember that the flag is a Boolean variable, therefore is true or false. It does not have to be compared to anything.

  Discuss factors that affect sorting in sediment

Discuss factors that affect sorting in sediment. How could one tell the latitude at which a sediment was originally deposited? Compare and contrast phosphate and manganese nodules.

  Create a road class

Create a Road class. The class should have functions for setting the width of the road in feet and the length of the road in miles. It should also have functions for obtaining the width of the road the length of the road.

  Calculates the total annual compensation of a salesperson

Write a Java application using an Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson

  Display at least the waiting at each floor

From the 1st floor, the elevator can only go in one direction - up. And from the 12th floor the elevator can only go in one direction - down.

  What is mean by swing and awt

What is mean by Swing and AWT and compare the statements break and continue with example in terms of their functions

  Create the look for two gui applications

Create the look for two GUI applications. You WILL NOT be getting the applications to do anything. We are only interested in seeing how well you can arrange the GUI components onto the window

  Design and implement a small and simple email server

Design and implement a small and simple email server using the concept of web based information system (WBIS).

  Create a 2-by-3 two-dimensional array of integers

Create a 2-by-3 two-dimensional array of integers and fill it with data. Loop through the array and locate the smallest value stored.

  Java programming murach 4th ed 1open the ch06ex1invoice

1.open the ch06ex1invoice project. take a screenshot after you open netbeans and paste it into a word or word

  1 rock-paper-scissors simplejavaproblems 1-3 are based on

1 rock-paper-scissors simple.javaproblems 1-3 are based on the rock-paper-scissors game. if you are unfamiliar with

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