The GATE Grind

GATE 2010 CS (CS1) – Question 22

Algorithms · Asymptotic Analysis and Time/Space Complexity · 1 mark · Multiple choice

Packages A,B process $n=10^k$ database records. A needs 0.0001n² time; B needs $10n\log_{10}n$. Find the smallest integer k for which B is faster.

  1. 12
  2. 10
  3. 6
  4. 5

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) 6

Explanation

B is preferred when 10×10ᵏ×k < 10²ᵏ⁻⁴, equivalently k<10ᵏ⁻⁵. At k=5 this is 5<1, false; at k=6 it is 6<10, true. Smaller positive integer k also fail. Thus k=6, C.

More Asymptotic Analysis and Time/Space Complexity questions

All Asymptotic Analysis and Time/Space Complexity questions →