The Gateway to Computer Science Excellence

+15 votes

Consider the following set of processes, with the arrival times and the CPU-burst times gives in milliseconds.$$\small \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time}\\\hline \text{P1} & 0 & 5\\ \text{P2} & 1 & 3\\ \text{P3} & 2 & 3 \\ \text{P4} & 4 & 1\\\hline \end{array}$$What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm?

- $5.50$
- $5.75$
- $6.00$
- $6.25$

+21 votes

Best answer

$$\small\begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Waiting Time = } & \textbf{Turnaround Time =} \\ & \textbf{(Turnaround Time - Burst time)} & \textbf{(Completion Time - Arrival Time )}\\\hline \text{P1} & 7 & 12 \\\hline \text{P3} & 0 & 3\\\hline \text{P2} & 3 & 6 \\\hline \text{P4} & 0 & 1\\\hline \end{array}$$

Average turnaround time $=12+3+6+1/4=22/4=5.5$

Correct Answer: $A$

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,647 questions

56,458 answers

195,367 comments

100,249 users