...
Question 6665 – UGC NET CS 2017 Jan- paper-3
November 25, 2023
DSSSB PGT 2021
November 25, 2023
Question 6665 – UGC NET CS 2017 Jan- paper-3
November 25, 2023
DSSSB PGT 2021
November 25, 2023

Question 13217 – Algorithms

Two algorithms A and B take n2 days and 2n seconds respectively to solve a problem on an instance of size n. What is the size of the smallest instance for which algorithm A outperforms B in the given choices?

Correct Answer: C

Question 532 Explanation: 
A = n2 days = n2 × 24 × 60 × 60 sec
B = 2n sec
The question is asking for what minimum value of n, A will take less time than B.
Let’s take option wise
A) n=10,
A = 102 × 24 × 60 × 60 = 2400 × 3600 sec
B = 210 = 1024 sec
Wrong.
B) n=20
A = 202 × 24 × 60 × 60 = 34560000
B = 220 = 1048576
Wrong.
C) n=30,
A = 302 × 24 × 3600 = 77760000
B = 230 = 1073741824
Yes, for n=30, A outperforms B.
A
10
B
20
C
30
D
40
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!