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 / simon y
Sorry guys, you failed the interview, and you got the
question wrong. It is what is the least number of
weighings - the answer is 2 not 3.
1) Take 2 random groups of 3 balls, compare them. If they
are the same you got lucky - the heavier ball is the one
you didn't weigh. If they are different you need step 2
2) Take the 3 heavier balls from weighing 1) and randomly
compare 2 of them. If one is heavier, that is the hevier
ball - if tehy are the same, then the one you didn't weigh
is the heavy one.
Is This Answer Correct ? | 29 Yes | 10 No |
Post New Answer View All Answers
write a C++ program for booking using constructor and destructor.
What is the significance of classes in oop?
What is object and example?
What causes polymorphism?
What is the example of polymorphism?
What is the real time example of encapsulation?
What is and I oop mean?
What is use of overloading?
What is object in oop with example?
What is balance factor?
What is the renewal class?
What is the point of oop?
What is the highest level of cohesion?
What is abstract class in oop?
#include