Description
Problem: You are given three sorted arrays A, B, and C each having n numbers. You can assume that you can compare two elements from A∪B∪C in O(1)-time. Let k be an integer. Design an algorithm that outputs the k-th smallest element of A∪B∪C. The running time of your algorithm must be faster than O(n). Try to optimize the running time of your algorithm as much as possible.
N.B. If your algorithm runs in O(n)-time, then you will receive at most 10% credit.
Guidelines: Please state any assumption you make. No such assumption should contradict with what the assumptions in the question says. For instance, if you want the array index to start from 0 to n− 1, please state it. But by default as per the question, the index is 1, . . . , n. Your answer must clearly explain the algorithm properly with a justification why the algorithm is correct. Additionally, your answer must give a clear explanation of your claimed running time. Missing explanations etc will deduct marks.
1
Reviews
There are no reviews yet.