Question: Multiple Choice Questions when f O(g) then this mean (a) f is growing faster than g (b) f is growing at the same rate as
Multiple Choice Questions
- when f O(g) then this mean
(a) f is growing faster than g (b) f is growing at the same rate as g
(c) f is growing slower than g (d) growth rate is not related to this statement
- if f(n) = n+1, g(n) = 2n and we prove that f(n) <= g(n) for n>=1 then
(a) f(n) (g) (b)f(n) (g) (c)f(n) O(g) (d)f(n) o(g)
- Consider the following algorithm
for i = 1 to lg2 n
k=n
while k>=1 do
-----
k=k/2
end while
end i
The complexity of the above algorithm is
a) (log2 n2) b) (log2 n ) c) (n log2 n) (d) ((log2 n)2 )
- 2n logn + 2n + 5 is in:
(a) (n2). (b)O (n2). (c) (n3). (d) (n3).
- The complexity of the following algorithm is
for (i = 0; i < n; i=i*2) {
for (j = 1; j < n; j++) {...}
}
a) (log2 n2) b) (log2 n ) c) (n log2 n) d) ((log2 n)2 )
- Which of these is the correct theta for 1+2+3+...+n?
(a) (log n) (b) (n) (c) (n log n) (d) (n)
- if A(n) = n log n +n2+1000 then A(n)
a) (n3) b) (n log n) c) O(n) d) (n2)
- Consider the following algorithm
For i=1 to n
For j= i to n
For k=1 to 10
x=x+k
End
End
End
The complexity of the above algorithm is
a) (n) b) ( n3 ) c) ( n2) d) (10)
- What is the worst-case time analysis for the following loop?
while (n > 0) { n = n/10; }
(a) (1) b) (log10 n) c) (n) d) (n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
