Completion Time: Time at which process completes its execution.
SJF will schedule the job which is having least burst time.
Hence, Average waiting time = (5 + 0 + 2) / 3 = 2.33
The first line contains a single integer 'N' which represents the number of processes.
The next 'N' lines contains two space-separated integers ‘at’ and ‘bt’ which represent arrival time and burst time for the 'ith' process, respectively.
Print a floating value of 2 decimal points that represent average waiting time.
You don’t have to print anything; it has already been taken care of. Just implement the given function.
You have to return the answers up to two decimal places.
The idea is to use the definition of the SJF. That is, first keep track of the process with the minimum arrival time because it will come first and then keep track of the process with the minimum burst time among the arrived process.