Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago