gravatar

Blog # 61 : Kth smallest element in union of 2 arrays


Given two sorted arrays of size M and N. Find Kth smallest element in the union of the two arrays in constant space. (i.e. without using additional space).

Click here to see the solution.
p.s. - For Remarks please hit the given link once. For Hint, hit it twice and for the solution, hit it thrice.



Courtesy: Vibhaj

gravatar

Can you explain the find_kth func for following input:
A:2,4,6,7,8
B:1,3,5
k=7
I don't think it'll work