1
23kviews
Solve the following Job Sequencing with deadlines problem. N = 7 Profits (P1, P2, P3, P4, P5, P6, P7) = {3, 5, 20, 18, 1, 6, 30} Deadlines (D1, D2, D3, D4, D5, D6, D7) = {1, 3, 4, 3, 2, 1, 2}
1 Answer
5
3.6kviews

Step: 1

We will arrange the profits Pi in descending order, along with corresponding deadlines.

enter image description here

Step: 2

Create an array J [] which stores the jobs. Initially j [] will be enter image description here

Step: 3

Add ith Job in array J [ ] at index denoted by its deadlines Di

First Job …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.