Data Structures & AlgorithmsVery hardGATE CS · TCS NQT

Four jobs need 5, 3, 4 and 1 units of time; a round-robin scheduler gives each job one unit per turn in queue order and removes finished jobs. What is the sum of the completion times of the four jobs?

  1. A. 39
  2. B. 38
  3. C. 37
  4. D. 13

Correct answer: B. 38

Simulate the round-robin queue one unit at a time, recording the time each job finishes. The jobs of length 1, 3, 4 and 5 finish at times 4, 9, 12 and 13, so the sum is 38.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic