Question: Python: Given two sorted arrays (one in ascending order and other in descending order) compare elements in both so the output of each list is

Python: Given two sorted arrays (one in ascending order and other in descending order) compare elements in both so the output of each list is in ascending order. Must have a function that passes in two arrays compareArrays(arr1, arr2, n)

For example:

Must be given two array of same length or size:

arr1=[1,4,5,11]

arr2 =[20,9,3,2]

output:

[1, 2, 3, 4] [5, 9, 11, 20]

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!