Data Structures & AlgorithmsHardGATE CS · ICPC regional
Five jobs (processing time, due date) are [(4, 9), (2, 6), (6, 12), (3, 7), (5, 10)]. They run one at a time with no preemption, starting at time 0 in any order you choose. What is the smallest possible maximum lateness (max of completion time − due date)?
- A. 8
- B. 10
- C. 20
- D. 9
Correct answer: A. 8
Earliest Due Date (EDD) order is optimal for maximum lateness: sort by due date and run the jobs back to back. Shortest-processing-time order minimises total completion time, not lateness, and can make the job with the earliest due date finish last.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- Stalls are at positions [1, 2, 8, 4, 9, 15, 17] on a line. You must place C = 4 cows in distinct stalls to maximise the MINIMUM distance…
- Books have page counts [12, 34, 67, 90, 25, 40, 18] in this fixed order. They are split among K = 3 students so that each student receives…
- Koko has banana piles [3, 6, 7, 11] and H = 8 hours. Each hour she eats up to k bananas from ONE pile (if a pile has fewer, she finishes…
- For the array [19, 4, 33, 12, 7, 29], find the smallest positive integer d such that the sum of ceil(x / d) over all elements is at most…
- In a 3 × 5 multiplication table (entries i × j for 1 ≤ i ≤ 3, 1 ≤ j ≤ 5), with repeats counted, what is the 7-th smallest entry?
- Flowers bloom on the days [1, 10, 3, 10, 2] (one flower per position). You need m = 3 bouquets, and each bouquet needs k = 1 adjacent…