0

If function $f(n) = \lg n$ (log of $n$ to base $2$), and assuming that the algorithm to solve the problem takes $f(n)$ microseconds, what is the largest size of $n$ that can be solved in $1$ sec.?

To process $32$ items, it would take $5$ microseconds.

Yogendra
  • 103

1 Answers1

1

You need to find the largest $n$ such that ${\hbox log}_2 n \leq 10^6$, since you are dealing with microseconds. You can raise both sides to the power of $2$ to solve.

user2566092
  • 26,142
  • I don't know what you mean by raising both sides to the power of 2. By the rules of logarithms, I came to the solution that 2 raised 1 million items can be processed in 1 sec. – Yogendra Sep 20 '13 at 21:55
  • It should be raise $2$ to the power of both sides, not the other way, which is squaring – Ross Millikan Sep 20 '13 at 21:57