We have a scale and 7 balls. 1 ball is heavier than all the
rest. How to determine the heaviest ball with only 3
possible weighing attempts?
Answer Posted / subir
(Step-1)Divide the balls into 2 groups of 3 each, and weigh
them. If they weigh same, then the 7th ball outside is the
heaviest.
(Step-2) If not then,
one of the 3 balls group being weighed is heavier. Take
them down and consider the heavier group, with one ball on
each side of the balance.
(Step-3)if they measure unequal, then the heavier one is
detected, and if they measure equal then the one outside is
heavier.
| Is This Answer Correct ? | 65 Yes | 5 No |
Post New Answer View All Answers
What is the significance of classes in oop?
What is abstraction example?
What is a function in oop?
What is object and class in oops?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
What is meant by oops concept?
Can you inherit a private class?
Why multiple inheritance is not possible?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is cohesion in oop?
What is the point of oop?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
what is the drawback of classical methods in oops?
Who invented oop?
what are the realtime excercises in C++?