Question: Question 5 (10.0 marks) In a recent UOW-SIM orientation camp, there are m number of male students and f number of female students. Unlike all
Question 5 (10.0 marks) In a recent UOW-SIM orientation camp, there are m number of male students and f number of female students. Unlike all previous orientation camps, where the number of male students, of different ages, is higher than the number of female students, this semester is the other way; that is f>m. The organizer of the camp would like to find out the ages among the students attending the camp that are common between both the female and male students. Device an efficient algorithm that runs on Of + m) lg 1) complexity, to achieve the needs of the organizer, that is, describe an algorithm (in pseudocode) that runs on o(cf + m) lgf) to find out the ages that are common between both the female and male students. You may use the following two lists as reference when you design your algorithm. For example: Agefemale: 20 18 23 21 19 22 17 Agemale: 18 18 23 20 Then, the output of your program should be 18, 20, and 23. (Note: When you plan your implementation, take a look at Question 6 (Part B) as well. There are hints that my help you in your design.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
