Q) The array T represents the diameters of various teacups, and the
array S, the diameters of saucers, both the arrays sorted in non-
decreasing order. The 'i'th cup (whose diameter is T[i]) can be
paired with the 'j'th saucer (whose diameter is S[j]) if and only if
S[j] >= T[i].
Given the sorted arrays 'S' and 'T', implement the 'C' function:
int getMaxNumberOfPairs(int* T, int* S, int no_cups, int no_saucers);
which would return the maximum number of cup and saucer pairings
possible for given arrays 'S' and 'T'.
For instance, given T = {15, 20, 20, 22, 30} and S = {10, 19, 26, 30},
the function should return '3' corresponding to any of the possible
maximal cup-saucer pairings, say, {[15,19], [20,26], [30,30]}, for
instance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---