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
What is encapsulation in simple terms?
#include
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
What is polymorphism explain?
Write a program to sort the number with different sorts in one program ??
Can a destructor be called directly?
Is data hiding and abstraction same?
What is polymorphism programming?
Who invented oop?
What does enum stand for?
What is interface? When and where is it used?
What does and I oop mean in text?
Explain the concepts involved in Object Oriented programming.
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is polymorphism and example?