Consider the following table about processes, their burst time and arrival…

2025

Consider the following table about processes, their burst time and arrival time

image.png


Now which of the process shall finish second last as per the respective GANTT charts for the non-preemptive SJF and Round Robin (time quantum = 10) scheduling methods.

  1. A.

    SJF : P₄ ; RR : P₄

  2. B.

    SJF : P₅ ; RR : P₄

  3. C.

    SJF : P₄ ; RR : P₃

  4. D.

    SJF : P₅ ; RR : P₅

Attempted by 104 students.

Show answer & explanation

Correct answer: D

**Non-preemptive SJF**

  1. **Time 0:** Processes P1(9), P2(30), P3(4) are ready. Shortest is **P3**. (Runs 0-4)

  2. **Time 4:** P1(9), P2(30) are ready. P4 arrived at 2 (Burst 8). Shortest is **P4**. (Runs 4-12)

  3. **Time 12:** P1(9), P2(30) are ready. P5 arrived at 6 (Burst 11). Shortest is **P1**. (Runs 12-21)

  4. **Time 21:** P5(11), P2(30) are ready. Shortest is **P5**. (Runs 21-32)

  5. **Time 32:** Only **P2** remains. (Runs 32-62)

**Completion Order:** P3, P4, P1, P5, P2. **Second Last: P5**.

**Round Robin (Quantum = 10)**

  1. **Time 0:** Q: [P1, P2, P3].

  • **P1** runs 9 (finishes at T=9). Q: [P2, P3] (+ P4 arrived at 2).

  • **P2** runs 10 (rem 20). Q: [P3, P4] (+ P5 arrived at 6).

  • **P3** runs 4 (finishes at T=23). Q: [P4, P5].

  • **P4** runs 8 (finishes at T=31). Q: [P5, P2].

  • **P5** runs 11 (finishes at T=42). Q: [P2].

  • **P2** runs remaining 10 (finishes at T=52).

**Completion Order:** P1, P3, P4, P5, P2. **Second Last: P5**.

**Final Answer:** SJF: P5 ; RR: P5 (Option D)

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor