Implement the methods in the myhashtable

Assignment Help JAVA Programming
Reference no: EM131596690

Question 1 Hash Table

You are given a MyHashTable class with code stubs, a Song class that describes song objects which will be stored in the hash table, and a HashTableTester class which uses a hash table to store a list of songs.

Your task:

Implement the following methods in the MyHashTable class:

- the constructor for the class MyHashTable
- the constructor for the inner class HashIterator
- put(), get(), remove(), rehash(), keys(), values()

For the specification of what these methods must do, see the comments in the code.

Question 2 Graph

You are given a Graph<T> class, and a Vertex<T> class, with generic argument T that represents the type of object that the vertex will contain. Inside the Graph class, the vertices are represented using a java HashMap object that is referenced by the vertexMap field. The HashMap keys are labels for the vertices. All methods of the Graph class are implemented for you.

You are also given a class ShapeGraph which extends the Graph class. The generic type is Shape which is itself an abstract class. The classes Triangle, Rectangle, Circle which extend Shape are also given to you. These classes compute the shape properties defined in the comments. (All the material you need for this question will be covered by the end of lecture 31 on Wed. Nov 23.)

Your task:

Implement the traverseFrom( String key, float threshold) method in the ShapeGraph class. This method finds the paths to all vertices that are reachable from the vertex defined by the key parameter, subject to the following condition: you must only return paths such that the total area along the path (the sum of the areas of the vertices) is greater than the threshold parameter.

For example, if there is a path 1->2->4->6->7->9, with all vertices having area 5, then the list returned by traverseFrom(1,16) should contain the paths

1->2->4->6
1->2->4->6->7
1->2->4->6->7->9

The paths 1, 1->2, and 1->2->4 do not have total areas above 16, and thus are not returned.

Your solution must use a recursive, depth first implementation. You must visit nodes within the adjacency lists in the order defined by the list. This will ensure that all students get the same paths (since for some graphs there may be multiple ways to go from vertex A to vertex B).

Attachment:- a.zip

Reference no: EM131596690

Questions Cloud

Reduce the overall drug error rate in the hospital : In your opinion, should the hospital staff who were responsible for the dispensing errors be held personally liable for the errors? Why or why not?
Implement a superclass vehicle and subclass car : Implement a superclass Vehicle and subclass Car and Truck. A vehicle has a position on thescreen. Write a method draw that draw cars and trucks
Electronic health care records : 1. List and illustrate the advantages and disadvantages of electronic health care records
Why mitigating risk is essential to operational efficiency : Using scholarly material, explain how Enterprise Resource Planning (ERP) Systems mitigate risk and assist in organizational decision making.
Implement the methods in the myhashtable : Implement the methods in the MyHashTable - All methods of the Graph class are implemented for you - Implement the traverseFrom
Discuss contributing factors and signs and symptoms : Discuss contributing factors and signs and symptoms that may be observed or assessed in these clients.
Historical and current patterns : You also looked at how the restrictionistsentiment increased and how the 1965 Immigration and Nationality Act changed the composition of immigration.
Discuss specific ways as a future advanced practice nurse : Discuss specific ways as a future advanced practice nurse,how you plan to integrate both theoretical concepts & the selected Essential into your daily practice.
Analyze and describe the key controls : Analyze the identity and access management approach that organizations need to implement to effectively control access to their systems.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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