in Algorithms recategorized by
2,260 views
0 votes
0 votes

If algorithm $A$ and another algorithm $B$ take $\log_2 (n)$ and $\sqrt{n}$ microseconds, respectively, to solve a problem, then the largest size $n$ of a problem these algorithms can solve, respectively, in one second are ______ and ______.

  1. $2^{10^n}$ and $10^6$
  2. $2^{10^n}$ and $10^{12}$
  3. $2^{10^n}$ and $6.10^6$
  4. $2^{10^n}$ and $6.10^{12}$
in Algorithms recategorized by
2.3k views

1 comment

it is 2^10^ 6 in actual question
0
0

1 Answer

4 votes
4 votes

 

For algorithm A problem solving time is log2(n) microseconds or lg(n) x 10-6 sec

 so in 1 sec what is the max value of n  such that lg n <= 10^6 

raising both side to power of n 

n<=2^10^6 

similarly 

for algorithm B  problem solving time is sqrt(n) microseconds or sqrt (n) x 10-6 sec

 so in 1 sec what is the max value of n  such that sqrt(n) <= 10^6 

squiring  both sides we get 

n<=10^6^2 =10^12 

Hence option B is correct ans 

https://udel.edu/~caviness/Class/CISC320-02S/exercise-solns/ch01/R-1.7.pdf

edited by
Answer:

Related questions