CUET PG 2021 — Computer PYQ
CUET PG | Computer | 2021Which of the following scheduling algorithms gives minimum average waiting time?
Choose the correct answer:
- A.
shortest job first
(Correct Answer) - B.
Round robin
- C.
priority
- D.
First come first serve
shortest job first
Explanation
Solution aur Logic
Sahi jawab hai: Shortest Job First (SJF).
SJF algorithm isliye sabse behtar maana jata hai kyunki yeh un processes ko pehle execute karta hai jinka execution time (burst time) sabse chota hota hai. Mathematical taur par, jab hum chote numbers ko pehle list karte hain, toh unka "cumulative sum" (jo waiting time banta hai) hamesha minimum aata hai
SJF ke do roop hote hain:
-
Non-preemptive SJF: Ek baar process shuru ho gayi toh khatam hone par hi rukegi.
-
Preemptive SJF (SRTF - Shortest Remaining Time First): Agar koi aur choti process aa jaye, toh current process ruk jati hai. SRTF hi woh algorithm hai jo technically "optimal" minimum waiting time deta hai.
Ek Example ke saath Samjhein
Maan lijiye 3 processes hain: P1(10ms), P2(3ms), P3(1ms).
1. FCFS (First Come First Serve) mein:
-
P1 wait karega: 0ms
-
P2 wait karega: 10ms
-
P3 wait karega: 13ms
AWT=30+10+13=7.66ms
2. SJF mein (Shortest Job First):
-
P3 (1ms) wait karega: 0ms
-
P2 (3ms) wait karega: 1ms
-
P1 (10ms) wait karega: 4ms
AWT=30+1+4=1.66ms
Yahan hum saaf dekh sakte hain ki:
Comparison Table
| Algorithm | Waiting Time | Characteristics |
| FCFS | High | Simple, lekin "Convoy Effect" hota hai. |
| SJF / SRTF | Minimum | Optimal, lekin burst time pehle se jaanna mushkil hai. |
| Round Robin | Moderate | Time sharing ke liye best hai. |
| Priority | Variable | Important tasks pehle hote hain. |
Final Answer: Shortest Job First (SJF)

