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 / madhu
divide balls as 3 + 3 + 1 and
1. weight them 3 balls and 3 balls if both are equal the
outer ball is bigger one. else
2. Add the single ball which is not weighted before to the
higher weight 3 balls and now it total balls will be 3+ 1
and divide them as 2 + 2
3. In second attempt weight them and find which is having
higher weight then take the higher weight group and in 3rd
attempt compare them individual and you will get the bigger
ball in three attempts.
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
How to hide the base class functionality in Inheritance?
What is a class in oop?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
write a programe to calculate the simple intrest and compund intrest using by function overlading
write knight tour problem which is present in datastructure
what type of questions
What is the difference between a mixin and inheritance?
What are classes oop?
What is encapsulation with real life example?
#include
What is abstract class in oop?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What does it mean when someone says I oop?
How do you explain polymorphism?
What is the real time example of inheritance?