GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Longest-Processing-Time-first scheduling puts jobs, in non-increasing order of length, on the currently least loaded machine. For jobs of lengths 5, 5, 4, 4, 3, 3, 3 on 3 identical machines, what makespan does it achieve? (The optimal makespan is 9.)
- A. 9
- B. 11
- C. 10
- D. 12
Correct answer: B. 11
LPT loads: 5, 5, 4, then 4 goes to the machine with 4 (8), 3 to 5 (8), 3 to 5 (8), and the last 3 to 8 → 11. The optimal assignment {5,4}, {5,4}, {3,3,3} gives 9; this is the classic tight example of the 4/3 − 1/(3m) bound.
More Algorithms questions
- For the string s = abaababaabaab (13 characters), a number p (1 ≤ p ≤ 13) is called a period if s[i] = s[i + p] for every valid i (p = 13…
- Boyer–Moore majority vote (candidate c and counter k; if k = 0 take the current element as c with k = 1; else increment k when equal and…
- In the Josephus problem 30 people numbered 1 to 30 stand in a circle; counting starts at person 1 and every third person is eliminated (3…
- Quicksort partitions m elements with exactly m − 1 comparisons and then recurses on the two sides (sizes k and m − 1 − k). Over all inputs…
- Keys 50, 30, 70, 20, 40, 60, 80 are inserted in this order into an empty binary search tree. How many of the 7! insertion orders of these…
- Floyd's cycle-finding is applied to the sequence x₀ = 2, x{i+1} = (xi² + 1) mod 55. How many distinct values does the sequence take?