recategorized by
2,304 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}$
recategorized by

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

0 votes
0 votes
1 answer
2
go_editor asked Nov 20, 2020
795 views
Match $\text{List I}$ with $\text{List II}$With reference to CMM developed by Software Engineering Institute (SEI)$\begin{array}{llll} & \text{List I} && \text{List II} \...
0 votes
0 votes
2 answers
3
go_editor asked Nov 20, 2020
1,001 views
Match $\text{list I}$ with $\text{List II}$$\begin{array}{llll} & \text{List I} && \text{List II} \\ (A) & \text{Topological sort of DAG} & (I) & O(V+E) \\ (B) & \text{Kr...
1 votes
1 votes
1 answer
4
go_editor asked Nov 20, 2020
876 views
Match $\text{List I}$ with $\text{List II}$$\begin{array}{llll} & \text{List I} & & \text{List II} \\ (A) & \text{Greedy Best-First Search} & (I) & \text{Space complexity...