GATE Computer ScienceModerateGATE CS (PYQ pattern)

How many comparators does Batcher's bitonic sorting network for 16 inputs use?

  1. A. 63
  2. B. 64
  3. C. 96
  4. D. 80

Correct answer: D. 80

The bitonic sorter for n = 2^k inputs has k(k+1)/2 stages of n/2 comparators: (16/2)·(4·5/2) = 8·10 = 80. Batcher's odd–even merge sort for 16 inputs uses only 63; both were checked to sort all 2¹⁶ binary inputs.

More Algorithms questions

Exams that ask this topic