Question: Suppose we are given two n-element sorted sequences A and B each with distinct elements, but potentially some elements that are in both sequences. Describe
Suppose we are given two n-element sorted sequences A and B each with distinct elements, but potentially some elements that are in both sequences. Describe an O(n)-time method for computing a sequence representing the union A∪B (with no duplicates) as a sorted sequence.
Step by Step Solution
3.35 Rating (170 Votes )
There are 3 Steps involved in it
Merge sequences A and B into a new sequ... View full answer
Get step-by-step solutions from verified subject matter experts
