GATE | GATE CS 2010 | Question 11
Two alternative packages A and B are available for processing a database having 10k records. Package A requires 0.0001n2 time units and package B requires 10nlog10n time units to process n records. What is the smallest value of k for which package B will be preferred over A?
(A)
12
(B)
10
(C)
6
(D)
5
Answer: (C)
Explanation:
Since, 10nlog10n ≤ 0.0001n2
Given n = 10k records.
Therefore,
⟹10×(10k)log1010k ≤ 0.0001(10k)2
⟹10k+1k ≤ 0.0001 × 102k
⟹k ≤ 102k−k−1−4
⟹k ≤ 10k−5
Hence, value 5 does not satisfy but value 6 satisfies. 6 is the smallest value of k for which package B will be preferred over A. Option (C) is correct.
Quiz of this Question
Please comment below if you find anything wrong in the above post
Please Login to comment...