Question: Let L 1 be a sorted array in increasing order of size n and L 2 be a sorted 1 0 array in decreasing order

Let L1 be a sorted array in increasing order of size n and L2 be a sorted 10 array in decreasing order of size m. Write an algorithm with O(n) running time to compute kth smallest element in L1 U L2 for a given L1,
L2 and k. Illustrate your algorithm for any sample input. For example, L1={10,11,15,16,17) and L2={14,13,9,8} and 4th smallest element in L1UL2 is 13.

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 Programming Questions!