Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the following set of processes, with... Start Learning for Free
Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds
Process                          Arrival Time                    Burst Time
P1                                           0                                        5
P2                                           1                                        3
P3                                           2                                        3
P4                                           4                                        1
 
Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?
  • a)
    5.50
  • b)
    5.75
  • c)
    6.00
  • d)
    6.25
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Consider the following set of processes, with the arrival times and th...
The following is Gantt Chart of execution
P1           P2            P4             P3        P1
1               4               5               8         12
Turn Around Time = Completion Time - Arrival Time   Avg Turn Around Time  =  (12 + 3 + 6+  1)/4 = 5.50
View all questions of this test
Most Upvoted Answer
Consider the following set of processes, with the arrival times and th...
Given:
- Arrival times of processes: P1 (0ms), P2 (1ms), P3 (2ms), P4 (4ms)
- Burst times of processes: P1 (5ms), P2 (3ms), P3 (3ms), P4 (1ms)

Preemptive Shortest Remaining Processing Time (SRPT) Algorithm:
- The SRPT algorithm selects the process with the shortest remaining burst time to execute first. If a new process arrives with a shorter burst time than the currently executing process, it preempts the current process and starts executing the new process.
- This algorithm aims to minimize the average turnaround time by prioritizing processes with shorter burst times.

Step-by-Step Solution:

1. Calculate the waiting time for each process:
- Initialize an array to store the waiting time for each process.
- Set the waiting time for the first process (P1) to 0.
- For the remaining processes (P2, P3, P4), calculate the waiting time by summing up the burst times of all preceding processes.
- The waiting time for P2 = Burst time of P1 = 5ms
- The waiting time for P3 = Burst time of P1 + Burst time of P2 = 5ms + 3ms = 8ms
- The waiting time for P4 = Burst time of P1 + Burst time of P2 + Burst time of P3 = 5ms + 3ms + 3ms = 11ms

2. Calculate the turnaround time for each process:
- Initialize an array to store the turnaround time for each process.
- For each process, calculate the turnaround time by adding its burst time and waiting time.
- The turnaround time for P1 = Burst time of P1 + Waiting time of P1 = 5ms + 0ms = 5ms
- The turnaround time for P2 = Burst time of P2 + Waiting time of P2 = 3ms + 5ms = 8ms
- The turnaround time for P3 = Burst time of P3 + Waiting time of P3 = 3ms + 8ms = 11ms
- The turnaround time for P4 = Burst time of P4 + Waiting time of P4 = 1ms + 11ms = 12ms

3. Calculate the average turnaround time:
- Sum up the turnaround times of all processes and divide by the total number of processes.
- Average turnaround time = (Turnaround time of P1 + Turnaround time of P2 + Turnaround time of P3 + Turnaround time of P4) / 4
- Average turnaround time = (5ms + 8ms + 11ms + 12ms) / 4 = 36ms / 4 = 9ms

Conclusion:
The average turnaround time for the given processes with the preemptive shortest remaining processing time first (SRPT) algorithm is 9ms. However, none of the provided options match this result. Therefore, it appears that the correct answer may not be among the given options.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer?
Question Description
Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer?.
Solutions for Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the following set of processes, with the arrival times and the CPU-burst times given in millisecondsProcess Arrival Time Burst TimeP1 0 5P2 1 3P3 2 3P4 4 1Q.What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm ?a)5.50b)5.75c)6.00d)6.25Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev