Let us apply the recursion-tree method for solving this recurrence problem:
The cost of the root is n because it is the combined cost to divide and merge back the results from the conquered subprocesses. Now here you can see that the height of the subtrees will be largest for T(n-1). It is equivalent to the fact mentioned by @arpitdhuriya that T(n-1) is asymptotically larger.
Hence the complexity would be O(n2)
More precisely, Ω(n2)
Why don't you give it a try and we correct.
Yes, None of the options is correct.
We can apply a bottom up approach (as you said) for better understanding:
1. SELECT P.pid FROM Parts P WHERE P.color<> 'blue' : Non-Blue parts id
2. SELECT C.sid FROM Catalog C WHERE C.pid NOT IN (1): Supplier ID who supply at least one blue part
3. SELECT S.sname FROM Suppliers S WHERE S.sid NOT IN (2): Supplier name who supplies only non-blue parts.
This is a simple one.
when you draw an n x n matrix like below:
So, you have (1+ 2 + 3 + 4 + .... n-1 + n = ) n(n+1)/2 places where you have elements present. How the size depends on the data type being stored in the array.
Hence size = n(n+1)/2 * sizeof(data_type)
That's how one should always approach to the problem. Remember, getting the solution is not our goal. Our aim should be to develop the problem-solving ability.
Why don't you give it a try, I will help you to reach to the answer.
Answer would be d) b & c
I want you to give it a try with the following hint:
- For broadcast, host ids will be all 1
- Assuming that the host bit N would be the host bit try to find the possible IPs
I suggest you to solve it by your own.