shortestjobfirst
Shortest Job First (SJF) is a CPU scheduling algorithm that selects the process with the shortest estimated CPU burst time to execute next. There are non-preemptive and preemptive variants; the latter is commonly called Shortest Remaining Time First (SRTF).
In non-preemptive SJF, once a process starts, it runs to completion. The scheduler keeps the ready queue
In the preemptive form (SRTF), a newly arriving process can preempt the current one if it has
SJF aims to minimize average waiting time when burst times are known or well estimated. However, it
Implementation typically uses a priority queue keyed by burst time, giving insert and selection times of O(log