Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  An operating system uses Shortest Remaining T... Start Learning for Free
An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:
Process                   Execution time                      Arrival time
P1                              20                                              0
P2                              25                                              15
P3                              10                                              30
P4                              15                                              45
Q. What is the total waiting time for process P2?
  • a)
    5
  • b)
    15
  • c)
    40
  • d)
    55
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
An operating system uses Shortest Remaining Time first (SRT) process s...
Shortest remaining time, also known as shortest remaining time first (SRTF), is a scheduling method that is a pre-emptive version of shortest job next scheduling. In this scheduling algorithm, the process with the smallest amount of time remaining until completion is selected to execute. Since the currently executing process is the one with the shortest amount of time remaining by definition, and since that time should only reduce as execution progresses, processes will always run until they complete or a new process is added that requires a smaller amount of time. The Gantt chart of execution of processes: 
At time 0, P1 is the only process, P1 runs for 15 time units. At time 15, P2 arrives, but P1 has the shortest remaining time. So P1 continues for 5 more time units. At time 20, P2 is the only process. So it runs for 10 time units. at time 30, P3 is the shortest remaining time process. So it runs for 10 time units. at time 40, P2 runs as it is the only process. P2 runs for 5 time units. At time 45, P3 arrives, but P2 has the shortest remaining time. So P2 continues for 10 more time units. P2 completes its execution at time 55.
As we know, turn around time is total time between submission of the process and its completion. Waiting time is the time The amount of time that is taken by a process in ready queue and waiting time is the difference between Turn around time and burst time. Total turnaround time for P2 = Completion time - Arrival time = 55 - 15 = 40 Total Waiting Time for P2= turn around time - Burst time = 40 – 25 = 15
View all questions of this test
Most Upvoted Answer
An operating system uses Shortest Remaining Time first (SRT) process s...
Solution:

Shortest Remaining Time first (SRT) process scheduling algorithm selects the process with the smallest amount of time remaining to execute. In case of a tie, it selects the process with the smallest arrival time.

Given arrival time and execution time for the processes:

Process Execution time Arrival time
P1 20 0
P2 25 15
P3 10 30
P4 15 45

To calculate the waiting time for process P2, we need to first calculate the completion time and turnaround time for all processes.

Completion Time:

Process Execution time Arrival time Completion time
P1 20 0 20
P2 25 15 40
P3 10 30 40
P4 15 45 60

Turnaround Time:

Process Execution time Arrival time Completion time Turnaround time
P1 20 0 20 20 - 0 = 20
P2 25 15 40 40 - 15 = 25
P3 10 30 40 40 - 30 = 10
P4 15 45 60 60 - 45 = 15

Waiting Time:

Process Execution time Arrival time Completion time Turnaround time Waiting time
P1 20 0 20 20 - 0 = 20 20 - 20 = 0
P2 25 15 40 40 - 15 = 25 25 - 25 = 0
P3 10 30 40 40 - 30 = 10 10 - 10 = 0
P4 15 45 60 60 - 45 = 15 15 - 15 = 0

The waiting time for process P2 is 0 as it is the first process to arrive and the shortest remaining time at that point in time.

Therefore, the total waiting time for process P2 is 0. Hence, option (B) is the correct answer.
Free Test
Community Answer
An operating system uses Shortest Remaining Time first (SRT) process s...
Man it's given straight the arrival time interval is 15 minutes for every process. Look at the left most side.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. Can you explain this answer?
Question Description
An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. 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 An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. 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 An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. Can you explain this answer?.
Solutions for An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. 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 An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. Can you explain this answer?, a detailed solution for An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:Process Execution time Arrival timeP1 20 0P2 25 15P3 10 30P4 15 45Q.What is the total waiting time for process P2?a)5b)15c)40d)55Correct answer is option 'B'. 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