Binary Search - AnswersAn ordered list is divided in 2 with each comparison.
Complexity of the following (Fibonacci Func.):
int fibRec(n){
if ( n <= 1){
return n;
else
return fibRec(n-1) + fibRec(n-2)); - AnswersO(2^n)
Name an example of O(N^3) complexity - AnswersMatrix multiplication
Order the following in terms of quickest growth
Linear Time : _________
Logarithmic Time : _________
Constant Time: _________
Quadratic Time : _________ - AnswersLinear Time - O(n) : 2
Logarithmic Time O(log n) : 3
Constant Time - O(1) : 4
Quadratic Time - O(n2) : 1
Order the following in terms of quickest growth:
O(1) : _________
O(2^n) : _________
O(n^2) : _________
O(n) : _________
O(nlogn) : _________
O(n!) : _________ - AnswersO(1) - 6
O(2^n) - 2
, O(n^2) - 3
O(n) - 5
O(nlogn) - 4
O(n!) - 1
Which of the followings is true?
a)Θ(f) - At the rate of f
b)O(f) - At most as fast as f
c)Ω(f) - At least as fast as f
d)Θ(f), O(f), Ω(f) gives us asymptotic behavior
e)All of the above - Answerse)All of the above
What does it mean when we say that an algorithm X is asymptotically more efficient than Y?
a)X will always be a better choice for small inputs
b)X will always be a better choice for large inputs
c)Y will always be a better choice for small inputs
d)X will always be a better choice for all inputs - Answersb)X will always be a better choice for large
inputs
the rate of Θ(f) - AnswersAt the rate of f
the rate of O(f) - AnswersAt most as fast as f
the rate of Ω(f) - AnswersAt least as fast as f
What is the asymptotic complexity of n + n^2 + 2n + n^4 ? - AnswersO(n^2)
What is the asymptotic complexity of 3n^2+ 10nlogn + 1000n + 4logn + 9999? - AnswersO(n^2)
What is the asymptotic complexity of n^3 + n^2 + n + log n? - AnswersO(n^2)
•What is the asymptotic complexity of n + 2^n + 3^n + n^4? - AnswersO(2^n)
What is the asymptotic complexity of nlogn + logn + n? - AnswersO(nlogn)
What is the asymptotic complexity of n! + n3 + 5n? - AnswersO(n!)