Unit 1
Father of Algorithm, What is Algorithm, Need of an algorithm, Algorithm Vs Program, Good Algorithm, Analysis of Algorithm, Comparison of running time, Asymptotic notation, Recurrence relation, Subtitution method, Iterative method, Recurrence Tree Method, Master Theorem, Extended Master Theorem.
Q41 – Find the time complexity
T(n) = T(n-1) + 1
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (2)
Explanation –Â
Q42 – Find the time complexity
T(n) = T(n-1) + n
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (2)
Explanation –
Q43 – Find the time complexity
T(n) = T(n-1) + n2
T(1) = 1
O(n2logn)
O(nlogn)
O(n3)
O(n2)
Ans – (3)
Explanation –
Q44 – Find the time complexity
T(n) = T(n-1) + logn
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (3)
Explanation –
Q45 – Find the time complexity
T(n) = T(n-1) + 1/n
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (1)
Explanation –
Q46 – Find the time complexity
T(n) = T(n-1) + √n
T(1) = 1
O(√n)
O(n)
O(n√n)
O(n2)
Ans – (3)
Explanation –
Q47 – Find the time complexity
T(n) = 2T(n-1) + n
T(1) = 1
O(nlogn)
O(n2)
O(2n)
O(4n)
Ans – (3)
Explanation –
Q48 – Find the time complexity
T(n) = T(n-1) + 2n
T(1) = 1
O(nlogn)
O(n2)
O(2n)
O(4n)
Ans – (3)
Explanation –
Q49 – Find the time complexity
T(n) = 2T(n-1) + 2n
T(1) = 1
O(2n*n)
O(2n*√n)
O(2n/n)
O(4n)
Ans – (1)
Explanation –
Q50 – Find the time complexity
T(n) = 2T(n-1) + logn
T(1) = 1
O(2n*n)
O(2n*√n)
O(2n)
O(4n)
Ans – (3)
Explanation –Â
Q51 – Find the time complexity
T(n) = √5T(n-1) + n
T(1) = 1
O(√5n)
O(√5n)
O(√5n/n)
O(5n)
Ans – (2)
Explanation –
Q52 – Find the time complexity
T(n) = T(n/2) + n
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (2)
Explanation –
Q53 – Find the time complexity
T(n) = 2T(n/2) + 1
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (2)
Explanation –
Q54 – Find the time complexity
T(n) = 2T(n/2) + n
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (3)
Explanation –
Q55 – Find the time complexity
T(n) = 4T(n/2) + n2
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2logn)
Ans – (4)
Explanation –
Q56 – Find the time complexity
T(n) = 3T(n/2) + n
T(1) = 1
O(3n/2)
O(n1.59)
O(n2)
O(n3)
Ans – (2)
Explanation –
Q57 – Find the time complexity
T(n) = 2T(n/3) + n
T(1) = 1
O(logn)
O(n)
O(nlogn)
O(n2)
Ans – (2)
Explanation –
Q58 – Find the time complexity
T(n) = 7T(n/2) + n2
T(1) = 1
O(logn)
O(n7/2)
O(nlog27 )
O(n3
Ans – (3)
Explanation –
Q59 – Find the time complexity
T(n) = 5/2T(3n/2) + n
T(1) = 1
O(log1.52.5)
O(n^log1.52.5)
O(nlogn)
O(n5/2)
Ans – (2)
Explanation –Â
Q60 – Find the time complexity
T(n) = 2T(n/4) + √n
T(1) = 1
O(√nlogn)
O(√n)
O(n√n)
O(n2)
Ans – (1)
Explanation –