Question: QUESTION 12 Let A={ x1, x2, ..., xn } and B = {y1, y2, ..., yn} be two sets of n elements each. Consider the

QUESTION 12 Let A={ x1, x2, ..., xn } and B = {y1, y2, ..., yn} be two sets of n elements each. Consider the problem of finding their intersections i.e. elements they have in common. a) Give (in details) a brute-force algorithm for solving this problem and determine its efficiency. Do not describe give pseudo code b) Improve on the brute-force algorithm in part (a) by sorting the elements first then finding the intersection. Any improvements? Give the efficiency of the algorithm
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
