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 / srini
let a,b,c,d,e,f,g be the 7 balls,
group them
a and b group 1
b and c group 2 and others one group
weigh group 1 against group 2
if they are not equal weigh the individual balls with
respect to each other
if they are not equal(group 1 is not equal to group 2)
weigh e against f, if they are not equal heaviest among
them is ur answer else g is the answer.
Is This Answer Correct ? | 6 Yes | 22 No |
Post New Answer View All Answers
what is difference between class template and template class?
What does and I oop mean in text?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
What is the difference between inheritance and polymorphism?
What is inheritance in oop?
What is a superclass in oop?
What is polymorphism in oop example?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
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 byval and byref? What are differences between them?
What is stream in oop?
Why do we use encapsulation in oops?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is polymorphism and its types?
What is class encapsulation?