Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
Algorithms
→
Analysis Of Algorithms (Recurrences) in Algorithms
→
Consider the following recurrence.T(n) = T() + Wha...
1.
Consider the following recurrence.T(n) = T() + What is the value of recurrence?(A) (B) (B) (B) (A) A(B) B(C) C(D) D
Answer»
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
Consider the following recurrence:Which one of the following is true?(A) T(n) = (loglogn)(B) T(n) = (logn)(C) T(n) = (sqrt(n))(D) T(n) = (n)(A) A(B) B(C) C(D) D
The running time of an algorithm is represented by the following recurrence relation: if n <= 3 then T(n) = n else T(n) = T(n/3) + cnWhich one of the following represents the time complexity of the algorithm?(A) (n)(B) (n log n)(C) (n^2)(D) (n^2log n)(A) A(B) B(C) C(D) D
Consider the following recurrenceT(n) = 3T(n/5) + lgn * lgnWhat is the value of T(n)?(A) (B) (c) (D) (A) A(B) B(C) C(D) D
Consider the following recurrence.T(n) = T() + What is the value of recurrence?(A) (B) (B) (B) (A) A(B) B(C) C(D) D
What is the value of following recurrence.T(n) = T(n/4) + T(n/2) + cn2T(1) = cT(0) = 0Where c is a positive constant(A) O(n3)(B) O(n2)(C) O(n2 Logn)(D) O(nLogn)
What is the worst case time complexity of following implementation of subset sum problem.// Returns true if there is a subset of set[] with sun equal to given sumbool isSubsetSum(int set[], int n, int sum){// Base Casesif (sum == 0)return true;if (n == 0 && sum != 0)return false;// If last element is greater than sum, then ignore itif (set[n-1] > sum)return isSubsetSum(set, n-1, sum);/* else, check if sum can be obtained by any of the following(a) including the last element(b) excluding the last element */return isSubsetSum(set, n-1, sum) ||isSubsetSum(set, n-1, sum-set[n-1]);}(A) O(n * 2^n)(B) O(n^2)(C) O(n^2 * 2^n)(D) O(2^n)
What is the value of following recurrence.T(n) = 5T(n/5) + ,T(1) = 1,T(0) = 0(A) Theta (n)(B) Theta (n^2)(C) Theta (sqrt(n))(D) Theta (nLogn)
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies