Question: You are given two sorted lists, A and B. The operation intersection (A, B) will compute (construct and return) An B (the intersection of A

 You are given two sorted lists, A and B. The operation

You are given two sorted lists, A and B. The operation intersection (A, B) will compute (construct and return) An B (the intersection of A and B: only those elements which are in both sets). For example, if A = [0, 2, 4, 6, 8, 10, 12] and B = [0, 3, 6, 9, 12, 15), the list [0, 6, 12 is returned. A. Write the procedure intersection (A, B). B. You may use only the public STL sequence container operations (see containers library documentation e). Don't overthink the problem (don't look for hacky solutions), just think about simple list operations (e.g. capacity, access, insert, remove). C. What is the running time of your procedure

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!