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


Please Help Members By Posting Answers For Below Questions

Explain virtual inheritance?

680


What is multilevel inheritance in oop?

547


Is enum a class?

596


What is polymorphism used for?

564


What is object and class in oops?

573






Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1776


Write a c++ program to display pass and fail for three student using static member function

2798


Can a varargs method be overloaded?

613


What is object-oriented programming? Webopedia definition

708


Is data hiding and abstraction same?

561


What is protected in oop?

596


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2157


Why is polymorphism needed?

584


What type of loop is a for loop?

675


What is the types of inheritance?

592