reset password
Author Message
G190852562
Posts: 162
Posted 22:41 Dec 06, 2014 |

1. What are the respective value of a, b, d for a binary search of a sorted array _____  what would be solution ___

 1, 2, 1 and O(n)
 2, 2, 2 and O(n)
 1, 2, 0 and O (lgn)
 2, 2, 0 and O(lg n)

Can someone explain how to do this?

4. For given )  recurrence : T(n) = 0.5T(n/2) + n  
what would be master method case:

 Case1 
 Case 2
 Case 3
 Not Applicable Master Method

For this problem, the last option is the answer since a is the number of subproblems and a = 0.5 which is not valid.

5. For Given recurrence : T(n) = 2n(n/2) + nn     
what would be master method case:

 Case1 
 Case 2
 Case 3
 Not Applicable Master Method

I got this problem correct and selected the last option. However, I selected it because 2^n is a function which is not a valid a. There is no T(n/2), it is simply (n/2). All-in-all, it is just not in the format of a recurrence relation.

6. For given recurrence: T(n) = T(n/2) + 2^n
If Master Method applicable, what would be solution.
 Not Applicable master method:

 O(2^n)
 O(n)
 O(2^n*logn)

Not sure of how to start on this one. This is not one of those recurrence relations with an f(n) that is non-polynomial, right?