4 votes 4 votes If job $J=(J_{1},J_{2},J_{3},J_{4})$ are given their processing time $T_{i}=(1,1,2,3)$ and deadline are $D_{i}=(3,4,2,3)$ maximum how many job can be done$?$ $A)1$ $B)2$ $C)3$ $D)All$ Algorithms algorithms greedy-algorithm algorithm-design job-scheduling + – Lakshman Bhaiya asked Nov 10, 2018 retagged Jul 8, 2022 by Lakshman Bhaiya Lakshman Bhaiya 12.3k views answer comment Share Follow See all 36 Comments See all 36 36 Comments reply Show 33 previous comments Lakshman Bhaiya commented Nov 10, 2018 reply Follow Share @Manas Mishra Yes minimum $2$ are required. can you edit you comment,why you place job $J_{1}$ and $J_{2}$ in the same grantt chart? 0 votes 0 votes Manas Mishra commented Nov 10, 2018 reply Follow Share @lakshman becoz only J1 and j2 can be completed and if u take any other job u wont will be able to complete .......... so i kept rest blank 0 votes 0 votes Sajal Mallick commented Nov 27, 2023 reply Follow Share In this question greedy property is maximum no of jobs done in deadline. So max deadline is 4. Always take that job that has large deadline and processing time low. Place it as close as deadline. If there is any tie among process/job then anyone can be taken. According to this first j3-->j3--->j1--->j2 will be done. So maximum job that can be done =3 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes see this approach .i maybe wrong .please verify it @shaik @srestha mam adarsh_1997 answered Nov 10, 2018 adarsh_1997 comment Share Follow See 1 comment See all 1 1 comment reply mithilesh bind commented Nov 18, 2018 i moved by Lakshman Bhaiya Nov 18, 2018 reply Follow Share 3 job 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes In greedy technique the job having less processing time Is preferred first so J3,J1,J2 will execute . Aprajita sachdev answered May 28, 2019 Aprajita sachdev comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Here, we will choose job with least processing time first and schedule it near deadline. We will move backwards in gantt chart as given deadline is the time till when job has to be completed. Let say we start J2 at 3 so we can complete it before deadline i.e 4. Same in case of J3. supreetshukla answered Jan 15, 2022 supreetshukla comment Share Follow See all 0 reply Please log in or register to add a comment.