assume that ur given jobs j1,j2,j3,j4,j5…j9 with known running time t1,t2,t3,…t9 what is the best way toschedule this job to minimize the average completion time . we will asume non primitive scheduling. once the job is started it must complete. write the code to solve the problem with appropriate functions
I think it will be solved by queues ..please solve the question and mention the code too
@kul_boii
Go with Shortest Job First implementation. Since all the jobs are already given , we do not have to make a ready queue or anything like that.
Just sort these jobs based on their time. Shorter jobs come first. That will give you your scheduling. Calculate the waiting time and everything else you wish to compute. Just take the input for each job in a pair<int,int> . Make an array or a vector of all these pairs and sort it based on the second parameter ( assuming you store the time of each job in the second part of the pair). That’s it.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.