Implement the bankers algorithm for deadlock avoidance

Assignment Help JAVA Programming
Reference no: EM133440902

Banker's algorithm

Implement the Bankers algorithm for deadlock avoidance, with a given set of N processes (N<10, processes are P1, P2, ..., PN) and M resource types (M<10, resources are R1, R2, ..., RM). Use Java or C/C++ for the implementation, with a simple interface, where the user only supplies the name of the input file (text file, say "input.txt"). The program reads all the necessary input data from that file. You are free to choose the format of the input file, just make sure it contains all the necessary data. The input data and the result of the algorithm must be displayed on the screen.

The pseudo code for the Greedy version for the Banker's algorithm can be found in this module's Commentary. We know that this algorithm only finds ONE solution (safe sequence of processes) assuming there is one; otherwise reports there is no solution.

You must adjust this algorithm to find exactly TWO solutions instead of just one (assuming of course there are at least two solutions). If the algorithm only has one solution this must be reported as such and the single solution must be displayed.

To resume, there are only three possible scenarios, for a correct input file:

1. There is no solution (no safe sequence). The program must report there is no solution.

2. There is EXACTLY ONE solution (safe sequence). The program must report there is exactly one solution. The solution must be displayed on screen.

3. There are TWO OR MORE solutions (safe sequences). The program must find EXACTLY TWO solutions. The solutions must be displayed on screen. If there are more than two solutions, it doesn't matter which ones are found, as long as they are exactly two.

Note 1: the solution must be based on the Greedy version for the Banker's algorithm; in particular, using an approach for finding ALL solutions and then keeping and reporting just two of them is NOT allowed.

Note 2: The input file may be incorrect, for various reasons. This must be checked and reported by your program before any attempt of finding a solution.

Reference no: EM133440902

Questions Cloud

What code set represents inpatient procedures : We use the UB04 form for inpatient hospital facility coding, but which codes do we use to identify the procedures that were done? What code set represents
What is the dsm 5-tr diagnosis based on the information : Summarize the clinical case. What is the DSM 5-TR diagnosis based on the information provided in the case? Which pharmacological treatment would you prescribe
Describe what leadership and management theories align with : Describe what leadership and management theories align with your leadership style. Based on your leadership style, discuss the type of work environment
Discuss reasons for healthcare professional turnover : discuss reasons for healthcare professional turnover and costs of turnover and strategies for increasing retention and preventing turnover.
Implement the bankers algorithm for deadlock avoidance : CMSC 412 Operating Systems, Implement the Bankers algorithm for deadlock avoidance, with a given set of N processes (N
How will knowledge about health care providers allow : How will knowledge about health care providers allow you to properly bill and code common gastrointestinal diseases? Provide details and support your responses
Discuss three to five competencies that you feel : Discuss three to five competencies that you feel you still need to work on. How do you plan to integrate this knowledge into developing your comprehensive
Discuss each step with the goal of providing quality care : Discuss each step with the goal of providing quality care. Use critical thinking skills and be outcome focused.
Review the four recommendations in the iom report the future : Review the four recommendations in the IOM report The Future of Nursing: Leading Change, Advancing Health and find your state's (Texas)_ action coalition.

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