Reference no: EM1380212
Implement the Banker's algorithm described in Section 8.5.3 using C/C++. Your program should ...
1) Prompt user to enter the size of matrix n and m. Your program should accept any n x m matrix and m vectors where n and m are positive integer less than 10.
2) Read in Allocation, Max, and Available from allocation.txt, max.txt, and available.txt, respectively. You can assume that each entry of the matrix (or vector) in the input files is separated with ' ' or 'n'. That is, the input files
7 5 3 3 2 2 9 0 2 2 2 2
and
7 5 3
3 2 2
9 0 2
2 2 2
are considered to be identical entries, and they can be interpreted as 1x12, 2x6, 3x4, 4x3, and etc depending on the user input n and m. Obviously, your program needs to handle the error when the total number of entries in matrix exceeding the total number of entries in input files.
3) Properly perform Safety algorithm to report user if the initial state is in safe state. If state is safe, report a safe sequence and go to step 4. If not, terminate the program.
4) Prompt user for new Requesti, perform Resource-Request algorithm, and perform Safety algorithm to report if the current state is safe. If state is safe, report a safe sequence. If state is unsafe, output "unsafe"
5) Repeat step 4 above until user terminates the program.
What the influence on the market supply of labor
: Use a graphical illustration to describe briefly what the influence of each of the following would be on the market supply of labor an increase in immigration
|
Difference between sequential, random and binary file access
: Discuss the difference between sequential file access, random file access, and binary file access? For each of the three types, provide an example of an application where the use of one type is better than the other 2-types.
|
Report writing mechanism
: Write a report. You can choose any scientific or informative report to write about
|
Creating a method find ranks in java
: Create a method findRanks in Java that accepts an unsorted array of integers vals, and starting and ending rank start and end, numbering ranks from 0,
|
Implementing the banker algorithm
: Prompt user to enter the size of matrix n and m. Your program should accept any n x m matrix and m vectors where n and m are positive integer less than ten.
|
Creating a big inteter calculator program
: Create a big-inteter calculator program that permits the user to enter two large integers and the operation to be performed and that calls appropriate function to carry out the designated operation.
|
Question about multi dimensional arrays
: Multi-dimensional arrays could cost a lot of memory. Determine how much memory does it take to create an integer array of 3 dimensions,
|
Income tax project
: osalyn uses the Cash Method Of Accounting for Federal Income Tax purposes for her business, ROSALYN'S BOOKSTORE, and the business code for the business for Federal Income Tax purposes
|
Definition of a method isreverse
: Provide the definition of a method, isReverse , whose two parameters are arrays of integers of equal size. The technique returns true if and only if one array is reverse of the other.
|