GateAI
Sorting

GATE CSE 2015 Set 3 · Q27

MCQ1 markMedium

Time

Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) 512

Sorting

The worst-case running time of mergesort on an input of size nn is given by:

T(n)=c⋅nlog⁡2nT(n) = c \cdot n \log_2 n

For n=64n = 64:

T(64)=c⋅64log⁡2(64)=c⋅64⋅6=384c=30 secondsT(64) = c \cdot 64 \log_2(64) = c \cdot 64 \cdot 6 = 384c = 30\text{ seconds}
  ⟹  c=30384=564 s\implies c = \frac{30}{384} = \frac{5}{64}\text{ s}

The maximum time available is 6 minutes=360 seconds6\text{ minutes} = 360\text{ seconds}. We need to find nn such that:

c⋅nlog⁡2n=360c \cdot n \log_2 n = 360
564nlog⁡2n=360  ⟹  nlog⁡2n=360×645=72×64=4608\frac{5}{64} n \log_2 n = 360 \implies n \log_2 n = \frac{360 \times 64}{5} = 72 \times 64 = 4608

Let us check the given options:

  • For n=512=29n = 512 = 2^9:

    nlog⁡2n=512×9=4608n \log_2 n = 512 \times 9 = 4608

Thus, n=512n = 512 solves the problem in exactly 66 minutes.

Hence, (B) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Sorting previous year question is Q27 of the GATE CSE 2015 Set 3 paper. Find more GATE CSE PYQs on Sorting in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 3 related Sorting PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Sorting in GATE CSE

Sorting has 3 GATE CSE PYQs across 3 papers from 2015 to 2025. 2 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2015 Set 3.

How GATE tests Sorting

More from GATE CSE 2015 Set 3

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 3 · Q27 · MCQ

Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.