Asymptotic-Complexity
October 26, 2023Asymptotic-Complexity
October 26, 2023Asymptotic-Complexity
Question 19 |
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?
12 | |
10 | |
6 | |
5 |
Question 19 Explanation:
As per given information Package B 10nlog 10 n is lesser than or equals to Package A 0.0001n 2 0
because n 2 is asymptotically larger than nlogn. Finally, 10nlog 10 n ≤ 0.0001n 2
Let n = 10 k records. Substitute into 10nlog 10 n ≤ 0.0001n 2
10(10 k )log 10 10 k ≤ 0.0001(10 k ) 2
10 k+1 k ≤ 0.0001 × 10 2k
k ≤ 10 2k−k−1−4
k ≤ 10 k−5
According to the problem value 6 is suitable for K.
because n 2 is asymptotically larger than nlogn. Finally, 10nlog 10 n ≤ 0.0001n 2
Let n = 10 k records. Substitute into 10nlog 10 n ≤ 0.0001n 2
10(10 k )log 10 10 k ≤ 0.0001(10 k ) 2
10 k+1 k ≤ 0.0001 × 10 2k
k ≤ 10 2k−k−1−4
k ≤ 10 k−5
According to the problem value 6 is suitable for K.
Correct Answer: C
Question 19 Explanation:
As per given information Package B 10nlog 10 n is lesser than or equals to Package A 0.0001n 2 0
because n 2 is asymptotically larger than nlogn. Finally, 10nlog 10 n ≤ 0.0001n 2
Let n = 10 k records. Substitute into 10nlog 10 n ≤ 0.0001n 2
10(10 k )log 10 10 k ≤ 0.0001(10 k ) 2
10 k+1 k ≤ 0.0001 × 10 2k
k ≤ 10 2k−k−1−4
k ≤ 10 k−5
According to the problem value 6 is suitable for K.
because n 2 is asymptotically larger than nlogn. Finally, 10nlog 10 n ≤ 0.0001n 2
Let n = 10 k records. Substitute into 10nlog 10 n ≤ 0.0001n 2
10(10 k )log 10 10 k ≤ 0.0001(10 k ) 2
10 k+1 k ≤ 0.0001 × 10 2k
k ≤ 10 2k−k−1−4
k ≤ 10 k−5
According to the problem value 6 is suitable for K.
Subscribe
Login
0 Comments