In this assignment, we are implementing the Banker's algorithm to check if the system is safe and if so the safe sequence will be outputted.
The Banker's Algorithm
In this program, we have a input file of numbers. The first and second number are the # of resources and the available. Then with the functins defined as a 2-d array. it reads the number then run through the algorithm.
The real challenge is reading the numbers to main.cpp
I define the file and then using the >> it read the first two numbers as number of resources and availablity then defining them in 2d arrays, the program kept writting the numbers into to the array and then ran it through banker's algorithm
Output: P1 -> P2 -> P3 -> P4 -> P0
Problem: Going through the file. I realize I am outputting the wrong order. I am sure it is due to how I wrote the txt file. Will notify professor more on it.
After looking back at it, the issue is how I am putting th numbers in the input file and maybe given how I am putting the numbers the ouput may not be wrong but it is not what the ouput if I were to put it all in one main file and define the numbers in the 2d array list