retagged by
963 views
1 votes
1 votes
worst case time complexity of job sequencing with deadline using greedy algorithm
retagged by

1 Answer

3 votes
3 votes
Job Sequencing with Deadline will occur in following  steps:

Step 1: Create an array whose size is equal is to the maximum deadline given.This will take constant time.

Step 2: Sort out the jobs in descending order of their profits. Best complexity: O(nlogn)

Step 3: Take the job one by one(O(n)) and find the particular slots to fix that job based on greedy analysis, worst case, slot will found in O(n) time. total complexity: O(n^2)

so overall complexity: O(1) + O(nlogn) +O(n^2) = O(n^2)...

Related questions

0 votes
0 votes
0 answers
1
Sajal Mallick asked Nov 27, 2023
182 views
As we have to select maximal set of “non overlapping” activities. So like job scheduling algo of greedy we can solve it. So according to that complexity must be O(n l...
0 votes
0 votes
3 answers
2
Deeptimittal97 asked Jul 6, 2017
10,142 views
What will be the time complexity to obtain optimal merge pattern to merge files using greedy technique?
4 votes
4 votes
3 answers
3
Lakshman Bhaiya asked Nov 10, 2018
12,503 views
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$ ...
0 votes
0 votes
2 answers
4
Vaishnavi01 asked Sep 25, 2018
1,344 views
Single source shortest path problems can be implemented by greedy algorithms usingA. Singly linked listB. Min heapC. AVL treeD. All of the above