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.
Re: 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.
Re: 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.
Re: 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.
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.
Re: 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.
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
Re: 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.
Re: 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.
one basket of apple,least possible way of interchange-1!
one basket of orange ,least possible way of interchange-1!
another has combination of apple nd orange,te least
possible way of interchange-3C2
the least possible way of interchange-1C1+1C1+3C2=5
Re: 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.
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.
Re: 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.
Re: 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.
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
Re: 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.
write an algorithm to get a sentence and reverse it in the
following format:
input : I am here
opuput: Here Am I
note: first letter of every word is capiatlised
Which of the following are valid "include" formats?
A)#include and #include[file.h]
B)#include (file.h) and #include
C)#include [file.h] and #include "file.h"
D)#include <file.h> and #include "file.h"
#define DCHAR char*
typedef char* TCHAR;
if using these following variables will be declared like
DCHAR ch1, ch2;
TCHAR ch3, ch4;
then what will be types of ch1, ch2, ch3 and ch4?
5. What kind of sorting is this:
SORT (k,n)
1.[Loop on I Index]
repeat thru step2 for i=1,2,........n-1
2.[For each pass,get small value]
min=i;
repeat for j=i+1 to N do
{
if K[j]<k[min]
min=j;
}
temp=K[i];K[i]=K[min];K[min]=temp;
3.[Sorted Values will be returned]
A)Bubble Sort
B)Quick Sort
C)Selection Sort
D)Merge Sort
what is the first address that gets stored in stack
according to a C or C++ compiler???? or what will be the
first address that gets stored when we write a C source
code????????
plz answer.... write a program that reads line (using
getline) e.g."345", converts each line to an integer
using "atoi" and computes the average of all the numbers
read. also compute the standard deviation.