SJF Algorithm

Shortest job first (SJF) is a scheduling policy that selects for execution the waiting process with the smallest execution time. SJF is a non-preemptive algorithm.  Shortest job first is advantageous because of its simplicity and because it minimizes the average amount of time each process has to wait until its execution is complete. However, it has the potential for process starvation for processes which will require a long time to complete if short processes are continually added.

SJF source code, pseudocode and analysis