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

  Consider a company that wants to keep track of its employees

Consider a company that wants to keep track of its employees, their positions and their telephone numbers. Your development team has developed a simple prototype using the Java code found in EmployeeDirectory.zip.

  Using a link list implementation

Using a link list implementation, simulate the war car game. The program should read an input of several line of card values and output the winner and the number of rounds it takes.

  Relation between the objects

What will be said about the relation between the objects object1 and object2 - Make this program using java programming.

  Your letterinventory class must use an array

Your LetterInventory class must use an array of Counter objects. Note that there is no nextChar method in the Scanner class. You must use the next() method and then use a loop through the characters of the token that is returned. Ignore any character..

  How is singlethreadmodel implemented in tomcat

How is SingleThreadModel implemented in Tomcat? In other containers? I would assume that Tomcat uses its connection thread pool, and creates a new instance of the servlet for each connection thread.

  Complete the classes cipher - caesar and transpose

Complete the classes Cipher, Caesar, and Transpose, and Reverser - Define an interface called Constants that will store the value 26 in the identifier WRAP_AROUND;

  All your code should be in the main method

Write a Java test program, all your code should be in the main method, that asks the user for two numbers representing an investment value and interest rate

  Implement a card game in java

In this assignment, you will be asked to implement a card game. You will need to make several design decisions for your code. It will be expected that all classes you write will utilize the principle of encapsulation.

  A regular polygon is an n-sided polygon

A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree(i.e the polygon is both equilateral and equiangular).

  Program that inputs a word representing a binary number

Write a program that inputs a word representing a binary number (0s and 1s). First your program should verify that it is indeed a binary number, that is the number contains only 0s and 1s.

  Write a program that reads a series of test scores

Write a program that reads a series of test scores from a recent test (integers in the range 0 to 100) until a sentinel value is read. A sentinel value is the value used to determine when to stop. The program then prints the following statistics f..

  What will unboxing do with null values

Java Question: Whatwill unboxing do with null values?

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