show that among any group of five (not necessary consecutive
) integers, there are two with the same remainder when
divided by 4.
Answer / lalala
generalized pigeon principle: If N objects are placed into k
boxes, then there is at least one box containing at least (ceiling) N/k objects.
let k = 4 ;
find N:
N/4 = 2 , N= 5, in order to get the answer 2..
| Is This Answer Correct ? | 17 Yes | 19 No |
Check for Balanced Parentheses using Stack?
What are the sizes and ranges of the basic c++ data types?
How a new element can be added or pushed in a stack?
What's the hardest coding language?
What are guid? Why does com need guids?
What is the cout in c++?
When is the destructor called?
Is java based off c++?
Difference between pointer to constant and constant pointer to a constant. Give example.
What is the difference between a declaration and a definition?
Differentiate between a constructor and a destructor in c++.
Define stacks. Provide an example where they are useful.