Data Structures & AlgorithmsVery hardICPC regional · GATE CS
Jobs of lengths [7, 6, 5, 4, 3, 3] are assigned to 2 identical machines. Each job runs on one machine without interruption. What is the minimum possible makespan (largest total load on any machine)?
- A. 15
- B. 28
- C. 14
- D. 7
Correct answer: C. 14
The lower bound ⌈28/2⌉ = 14 is reached by {7, 4, 3} and {6, 5, 3}, so 14 is optimal. Greedy least-loaded assignment taking jobs in ascending order ends at 15; 28 puts everything on one machine and 7 is just the longest job.
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
- Intervals (half-open, [start, end)) are [(1, 3), (2, 4), (3, 5), (4, 6), (5, 7), (6, 8)]. What is the minimum number of intervals you must…
- Weighted jobs (start, end, weight) are [(1, 3, 5), (2, 5, 6), (4, 6, 5), (6, 7, 4), (5, 8, 11), (8, 9, 2)]. Two jobs are compatible when…
- Items as (weight, value) are [(10, 60), (20, 100), (30, 120)]. You may take any FRACTION of an item. The capacity is 50. What is the…
- 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…
- 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…