What is first come first serve Scheduling (FCFS):-
In this scheduling algorithm we allocate CPU to process that comes first in the ready queue. That is, the process that comes first in the ready queue will gets the CPU first. So it's called first come first serve algorithm.
It is Non preemptive it means in FCFS Scheduling once the CPU has been allocated to a process , the process keeps the CPU until it releases the CPU either by terminating or by requesting I/O.
Advantage:-
- Easy to implement
- Easy to understand
- The simplest form of a CPU scheduling algorithm
Disadvantage:-
- Average waiting time is often quite longer
- Because of its simplicity, FCFS is not very efficient
- Not an ideal technique for time-sharing systems
C program:-
Here I am going to give to two solution .In the first Code we will just use Array and in the second Code we will use structure .
Code 1:-
In this code we simply declare Some array for the arrival time , Burst time ,Waiting time , and turn around time .
First we take a input from the user which is number of process in the Ready queue.then After we take Arrival time and Burst time of all the process one by one.Aftet that we will calculate the waiting time and Turn Around time of all the process and store it in the Array WT and TT respectively .
Output:-
Code 2:-
In This Code first we create the structure for the process .Then after we declare an array of structure type .
cmpl_T stands for completion time of the process which we are calculating in the program.
Output:-
Wipro :-
- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID
Infytq :-
Key Points;-
Hackerrank:-
- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution
C-tutorial:-
- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array
See more:-
- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation
2 Comments
Good keep it up dear
ReplyDeleteHow to give input for AT and BT? Im getting wrong output....
ReplyDelete