There are 3 baskets of fruits with worng lables,one basket
has apple,another basket has orange,another has combination
of apple and orange,what is the least way of interchange
the lables.

Answers were Sorted based on User's Feedback



There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / nitinbhatia2211

Lets Say Basket as B1, B2, B3 labelled Apple, Orange and
Apple&Orange respectively.
As all the Baskets have wrong labels, we are sure for one
thing that Basket B3 doesn't contain Apples&Orange So we
will first take out the fruit from it. Suppose its Apple
then surely B3 will get its real label i.e. Apple.
And as again we know that the all baskets were wrongly
labelled... interchange the labels of basket B2 and B1.

So finally we have B1, B2 and B3 containing Orange,
Apple&Orange and Apple respectively.

Therefore the least no of ways to find out the correct
labels is ONE only.

Is This Answer Correct ?    47 Yes 4 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / anoop

Beside answer 3, following is one more alternative:

Let the 3 baskets with labels A,O,M.
Interchange labels of any 2 baskets. (assume that u
interchanged lables of A & O)

Now see (or take out) the fruits of either of the baskets
with changed labels (A & O).

There wud be 2 cases:
1. This basket(the one of which u saw (or took out) the
fruits) has fruits not conforming to the label.
2. This basket(the one of which u saw (or took out) the
fruits) has fruits conforming to the label.

If (1) is true,just interchange its label with the third
untouched basket (basket with label M).

If (2) is true, just interchange label of other basket with
the third untouched basket (basket with label M).

Idea is : Just one interchange of labels of any 2 basket
will fix one basket with correct label. In second step you

Is This Answer Correct ?    6 Yes 0 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / anoop

continued ...

..In second step interchanging the left 2 baskets will fix
all 3 with the right labels.

Is This Answer Correct ?    5 Yes 0 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / rahul

watch out for the fruits ,suppose the label on 1 is proper
we will be having 1 way but if the label and the content in
the basket totally miss match then we need min 2 ways
ANS;2

Is This Answer Correct ?    2 Yes 1 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / priya

Smell the baskets : and change the labels!
Apple doesnt smell like oranges, so its easy . Why
Complicate it!!!

Is This Answer Correct ?    1 Yes 0 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / soumava bose

suppose B1,B2,& B3 care the baskets.Now we will first open
B1.suppose it contains Oranges.Then its level would be
either Appale or Combination.Now suppose The lebel is
combination.Now the basket with lebel orange is
interchanged with it.As initially all baskets had wrong
lebels.so the basket with lebel appale must have either
orange or combination.so now we interchange the two lebels
of the remaining baskets & get the proper answer.

Is This Answer Correct ?    1 Yes 1 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / dinesh

why i am going to interchange the lables,as from question
" 3 baskets of fruits with worng lables ............"
but they haven't mentioned to take all it to put in correct
lable with respectively basket of fruits

Is This Answer Correct ?    1 Yes 1 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / murali(jjcet)

just change the lables of each basket fr eg..if there apples
in the basket then paste the apple label fr it.....it will
be same fr both....

Is This Answer Correct ?    0 Yes 0 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / ankur

zero.

why do we want to interchange the lables. Question gives
incomplete details.

Is This Answer Correct ?    1 Yes 1 No

There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,ano..

Answer / muthurangaraja

In this question they will say that baskets are labelled but not closed . so we can easily interchange the fruits

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Is register a keyword in c?

0 Answers  


what is data structure?

5 Answers   CBSE,


What is the process to create increment and decrement stamen in c?

0 Answers  


What is #define size in c?

0 Answers  


What should be keep precautions while using the recursion method?

1 Answers  






show how link list can be used to repersent the following polynomial i) 5x+2

0 Answers   CBSE,


what are the 10 different models of writing an addition program in C language?

0 Answers  


What is the difference between int main and void main?

0 Answers  


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

0 Answers  


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

0 Answers  


int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?

3 Answers  


Explain what is the best way to comment out a section of code that contains comments?

0 Answers  


Categories