Unit 3,4 Question Bank
Unit 3,4 Question Bank
P1 0 4
P2 1 3
P3 2 1
P4 3 2
P5 4 5
Using the First Come First Serve (FCFS) scheduling algorithm (non-preemptive),
construct a Gantt chart for these processes.
Calculate the Completion Time, Waiting Time, and Turnaround Time for each process, and determine the
average waiting time and average turnaround time.
Q. Consider the following set of processes with their respective arrival times and burst times:
Answer:
Using FCFS scheduling, we serve each process in the order they arrive in the ready queue.
P1 | P2 | P3 | P4
0 5 8 9 11
Final Answer:
• Waiting Time for each process: P1 = 0, P2 = 3, P3 = 4, P4 = 4
• Turnaround Time for each process: P1 = 5, P2 = 6, P3 = 5, P4 = 6
• Average Waiting Time = 2.75
• Average Turnaround Time = 5.5
Q. Consider the following set of processes with their respective arrival times and burst times:
Process Arrival Time Burst Time
P1 0 7
P2 2 4
P3 4 1
P4 5 4
Calculate the waiting time and turnaround time for each process using the SJF scheduling
algorithm, and find the average waiting time and average turnaround time.
Answer:
In SJF (non-preemptive), the process with the shortest burst time is selected when the CPU is free
and ready to execute a process.
P1 | P2 | P3 | P4
0 7 11 12 16
Final Answer:
• Waiting Time for each process: P1 = 0, P2 = 5, P3 = 7, P4 = 7
• Turnaround Time for each process: P1 = 7, P2 = 9, P3 = 8, P4 = 11
• Average Waiting Time = 4.75
• Average Turnaround Time = 8.75