The organizer of the camp would like to find out the ages


Question 1

In a recent orientation camp, there are m number of male students and f number of female students. Like all previous orientation camps, the number of male students, of different ages, is higher than the number of female students; that is m >f.

The organizer of the camp would like to find out the ages among the students attending the camp that are common between both the male and female students.

Device an effective algorithm that runs on 0 (m log f) complexity, to achieve the needs of the organizer, that is, describe (in pseudocode) an algorithm that runs on 0 (m log f) to find out the ages that are common between both the male and female students.

You may use the following 2 lists as reference when you design your algorithm.

2182_Example.jpg


The output of your program should be 22, 19.

Question 2

Write a Java program that implements the algorithm that you have come out with in the previously Question 1.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: The organizer of the camp would like to find out the ages
Reference No:- TGS02759493

Now Priced at $50 (50% Discount)

Recommended (91%)

Rated (4.3/5)