GateAI
Searching, Sorting and Hashing

GATE CSE 2013 · Q30

MCQ2 marksMedium

Time

The number of elements that can be sorted in Θ(log⁡n)\Theta(\log n) time using heap sort is

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) ((log n)/(log log n) )

Searching, Sorting and Hashing

Let kk be the number of elements to be sorted.

The time complexity of heap sort to sort kk elements is Θ(klog⁡k)\Theta(k \log k).

We are given that the sorting time is Θ(log⁡n)\Theta(\log n), so:

klog⁡k=Θ(log⁡n)k \log k = \Theta(\log n)

Let us test option (C), where k=Θ(log⁡nlog⁡log⁡n)k = \Theta\left(\frac{\log n}{\log \log n}\right):

klog⁡k=Θ(log⁡nlog⁡log⁡n⋅log⁡(log⁡nlog⁡log⁡n))k \log k = \Theta\left(\frac{\log n}{\log \log n} \cdot \log\left(\frac{\log n}{\log \log n}\right)\right)
=Θ(log⁡nlog⁡log⁡n⋅(log⁡log⁡n−log⁡log⁡log⁡n))= \Theta\left(\frac{\log n}{\log \log n} \cdot (\log \log n - \log \log \log n)\right)
=Θ(log⁡nlog⁡log⁡n⋅log⁡log⁡n(1−log⁡log⁡log⁡nlog⁡log⁡n))= \Theta\left(\frac{\log n}{\log \log n} \cdot \log \log n \left(1 - \frac{\log \log \log n}{\log \log n}\right)\right)
=Θ(log⁡n)= \Theta(\log n)

Thus, k=Θ(log⁡nlog⁡log⁡n)k = \Theta\left(\frac{\log n}{\log \log n}\right) elements can be sorted in Θ(log⁡n)\Theta(\log n) time using heap sort. Option (C) is correct.

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 Searching, Sorting and Hashing previous year question is Q30 of the GATE CSE 2013 paper. Find more GATE CSE PYQs on Searching, Sorting and Hashing 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 5 related Searching, Sorting and Hashing 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.

Searching, Sorting and Hashing in GATE CSE

Searching, Sorting and Hashing has 27 GATE CSE PYQs across 20 papers from 2012 to 2026. 7 of them are 2-mark MCQs like this one, and GATE CSE 2013 has 2.

How GATE tests Searching, Sorting and Hashing

More from GATE CSE 2013

Share this solution

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

GateAI solution cardGATE CSE 2013 · Q30 · MCQ

The number of elements that can be sorted in (log n) time using heap sort is

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.