Question: a) Design an algorithm that inputs two lists of numbers, A, and B, of lengths n and m respectively, and finds out (and prints) how
a) Design an algorithm that inputs two lists of numbers, A, and B, of lengths n and m respectively, and finds out (and prints) how many common elements they contain. For example, if A contains 104, 195, 26, 503, 404, 793, 39, 995 and B contains 612, 27, 39, 321, 104 the algorithm will output 2 (because 39 and 104 are common to both lists).
(b) What is the efficiency of your algorithm in terms of m and n?
-Please use simple psudocode
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
