Answer:
There is also an attachment below
Explanation:
Since we are talking about binary search, let's assume that the items are sorted according to some criteria.
Time complexity of binary search is O(logN) in worst case, best case and average case as well. That means it can search for an item in Log N time where N is size of the input. Here problem talks about the item not getting found. So, this is a worst case scenario. Even in this case, binary search runs in O(logN) time.
N = 700000000.
So, number of comparisions can be log(N) = 29.3 = 29.
So, in the worst case it does comparisions 29 times
Answer:
Explanation:
Depends on the configuration of the email because there are two protocols POP and IMAP, the most recent protocol is IMAP, we can delete an email and this It moves to a To be Deleted folder, this happens because the email is stored in the server, but with the protocol POP the email is stored in the server and downloaded to the application, if you delete an email, this is deleted in all devices.
Answer:
B. 1 6 3
Explanation:
Given function definition for calc:
void calc (int a, int& b)
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}
Function invocation:
x = 1;
y = 2;
z = 3;
calc(x, y);
cout << x << " " << y << " " << z << endl;
- Since x is passed by value, its value remains 1.
- y is passed by reference to the function calc(x,y);
Tracing the function execution:
c=3
a=3
b=c+a = 6;
But b actually corresponds to y. So y=6 after function call.
- Since z is not involved in function call, its value remain 3.
So output: 1 6 3