subject

Suppose you are given the following data structure, variables and several functions to manage the list of processes in a CPU scheduling algorithm. struct list_item{
struct Proc_Ctrl_Block *PCB;
int cpu_burst; int io_burst;
struct list_item *next;
} struct list_item *head=NULL, *tail=NULL;
Suppose we have several functions that are already implemented to create new list items, associate them with PCBs which we don't consider here, add/insert a given item to the end of the list, which is accessed through global variables: head and tail. Now you are asked to implement the following two Get_... functions!
struct list_item *Get_next_item_FCFS( );
/* remove the first item from the beginning of the list, and returns its address. If there is no item, return NULL */
struct list_item *Get_next_item_SJF( );
/* remove the item that has the shortest cpu_burst time from the list, and returns its address. If there is no item, return NULL. Note that the list is not sorted! */
My code looks like this:
*Get_next_item_FCFS( ){
struct list_item *tmp;
UNSURE WHERE TO GO FROM HERE
*Get_next_item_SJF( ){
struct list_item *tmp, *prev,
*min_i, *prev_i;

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
question
Computers and Technology, 25.06.2019 09:20
The technology acceptance model (tam) is a two-factor model that describes user acceptance of new or replacement technology solutions (davis, 1989). this evaluation model has withstood the test of time and is widely used. the model is based upon perceptions and beliefs of individuals and measures two types of factors: (a) perceived ease of use and (b) perceived usefulness. prepare an analysis (briefing paper) (5 to 7 strong paragraphs) in which you explain how cybersecurity researchers could use the tam model to explore the factors which affect employee acceptance of biometrics used for access to facilities and/or computing systems. what research questions might they ask? what measurements would be needed? post your briefing paper as a reply to this topic. remember to cite your sources (3 minimum) and include a reference list at the end of your posting.
Answers: 1
You know the right answer?
Suppose you are given the following data structure, variables and several functions to manage the li...
Questions
question
Mathematics, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10
Questions on the website: 13722361