Answer:
Explanation:
( n cards are there initially )
we pick out the first card in random it takes n-1 comparisons to figure out
its Equivalence card - n-1 steps
Two cards have been eliminated ( this leaves us with 2 and n-2 cards)
we pick out the 2nd card in random it takes n-3 comparisons to figure out
its Equivalence card - n-3 steps
we continue to do this.. till all cards are exhausted ( leaves us with 2
and n-4 cards again)
the last comparison will
have
- n-(n-3)
the sum of all these steps - (n-1) + (n-3) + (n-5) + .........+
(n-(n-3))
if you draw this in the form of a tree.
n - n
2
n-2 - n
2
n-4 - n-2
2
n-6 - n-4
2
n-8 - n- 6
the height of the tree will be log n , sum @ each level is at most n
Because if im talking to someone in english but they are from china and communicating to me in chinese then thas what itll do
Answer: It allows you to locate materials, be aware of your assignments and plan time to get things done.
Hope it helped.
Answer:
These are the supplies in the list:
[‘pencil’, ‘notebook’, ‘backpack’, ‘pen’, ‘calculator’]
Explanation:
The line return (\n) character will be in the output (so there will be a change of line), but it will NOT be visible as it would have been interpreted as a special character.
So the output will be on 2 different lines, with no \n visible.
If the command would have been: print('These are the supplies in the list:\n', supplies), with single quotes (') instead of double quotes (") then then \n would have been printed but not interpreted as a special character. At least in most computer language. Since we don't know of which language the question refers to, we can't be sure at 100%.
#include using namespace std;int main(){int year = 12,value = 10,total = 0;do{year++;value *= 2;total += value;}while(value*2 < 1000);cout << "Age: " << year << endl;cout << "Last gift: " << value << endl;cout << "Total: " << total << endl;cin.get();return 0;