SJF Works. We can use the same code for other algorithms.