job sequencing with deadlines in daa

Solutions on MaxInterview for job sequencing with deadlines in daa by the best coders in the world

showing results for - "job sequencing with deadlines in daa"
Cassandra
15 Nov 2020
1Algorithm: Job-Sequencing-With-Deadline (D, J, n, k) 
2D(0) := J(0) := 0 
3k := 1 
4J(1) := 1   // means first job is selected 
5for i = 2 … n do 
6   r := k 
7   while D(J(r)) > D(i) and D(J(r)) ≠ r do 
8      r := r – 1 
9   if D(J(r)) ≤ D(i) and D(i) > r then 
10      for l = k … r + 1 by -1 do 
11         J(l + 1) := J(l) 
12         J(r + 1) := i 
13         k := k + 1 
14