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

You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

0 Answers  


write a program for 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 4 4

1 Answers  


Explain how does flowchart help in writing a program?

0 Answers  


what is c

4 Answers  


What is || operator and how does it function in a program?

0 Answers  






What are the different types of C instructions?

0 Answers   InterGraph,


what is use of malloc and calloc?

0 Answers  


What is a header file?

0 Answers  


void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?

4 Answers   Groupon,


What is spaghetti programming?

0 Answers  


Why string is used in c?

0 Answers  


char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)

7 Answers   Mascot,


Categories