Data Structures & AlgorithmsHardGATE CS · TCS NQT

Three jobs given as (processing time, weight) are (3, 2), (1, 4), (2, 1). They run one at a time from time 0. What is the minimum possible sum of weight times completion time?

  1. A. 20
  2. B. 18
  3. C. 17
  4. D. 12

Correct answer: B. 18

Smith's rule orders jobs by processing time divided by weight, which is an adjacent-exchange argument. Ordering by processing time alone (or by weight alone) can be suboptimal.

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

Exams that ask this topic