a list, C, of distinct elements, in increasing order, that are in A but not in B and in B but not in A.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 5SA
icon
Related questions
Question

Let A and B be two integers valued arrays of sizes n1 & n2 respectively. The elements of the two arrays are sorted in increasing order and may contain duplicate elements.
It is required to form a list, C, of distinct elements, in increasing order, that are in A but not in B and in B but not in A. (There shall be no duplicate elements in list C.)
The two arrays, A & B, can only be traversed once.
Example:
A: -2, 2, 4, 4, 4, 7, 9, 9, 9, 12, 15,
B: 1, 2, 5, 9, 15, 15, 15, 17, 17, 17
C: -2, 1, 4, 5, 7, 12, 17

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning