Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started