Implement and test the algorithm

Assignment Help JAVA Programming
Reference no: EM131512623

Java Program:

Implement and test the following algorithm which computes an optimal sequence for performing a set of tests that does not violate a given precedence constrains on the tests sequencing. The precedence constraints are represented by an array of disjoined linked lists of test, where the ith test in a linked list is the immediate successor of the (i-1)th  test in the same linked list. For each test, there are cost of testing i and probability of positive result . An optimal sequencing of tests is based on the minimizing the expected   testing cost   It has been proven that the following Greedy algorithm provides an optimal sequencing of tests.

Assume the array of linked lists is dented by L, where L[i][k] is the kth test in the linked list L[i] and the its immediate predecessors are L[i}{0}, L[i}[1],....L[i][k-1]. Let C[i][k] and P[i][k] be the cost and probability associated with the test L[i][k]

The Algorithm

1. Let OP denotes an optimal sequence and set it to the empty string;

2. While (the linked lists are not completely empty), Do the following four steps:

3. For each test L[i][j], compute the ratio R[i][j] as follows:

R[i][j] =  (k=0jC[i][k])/(k=0jP[i][k])

4. Choose the test with the smallest R ratio and has no predecessor test with the same R ratio;

5. Add this test with its predecessors tests to the optimal sequence OP;

6. Remove this test and its predecessors from its linked list.

7. Return OP.

Reference no: EM131512623

Questions Cloud

Getting a small amount of funds : As an epidemiologist you request and succeeded in getting a small amount of funds to conduct an epidemiological study to test the above hypothesis.
What was the percentage of change : Which state had the greatest change in average median income from 2010-2011 to 2012-2013? What was the percentage of change?
Describe the means in which the technology operates : Describe the technology used in special detection devices (gas, UV/IR, video, etc.) and describe the means in which the technology operates.
Purchasing an electronic health record : Scenario: Currently the facility where you are employed has paper records. They are looking at purchasing an Electronic Health Record (EHR).
Implement and test the algorithm : Implement and test the following algorithm which computes an optimal sequence for performing a set of tests that does not violate a given precedence
Write a paper about division between the north and south : Write a Paper about Division Between the North and South. Withdrawal of the Southern States lead to the establishment of Civil War and the Confederacy.
Leader of this group appear to exhibit : What type of leadership style did the leader of this group appear to exhibit? Give some specific examples of the type of leadership behavior used.
Write paper about changes necessary to the military uniform : The United States military has made an extensive change in their uniform over the years. Write a paper about Changes Necessary to the Military Uniform.
Overview of how health care in the united states : Provide an overview of how health care in the United States has evolved since the postindustrial period.

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