http://www.geeksforgeeks.org/median-of-two-sorted-arrays-of-different-sizes/
This gives a reasonable solution. However, I would use iteration instead of
tail recursion.
Don
On Monday, January 6, 2014 4:15:41 AM UTC-5, atul007 wrote:
@dave : could you provide pseudo code for ur approach
On 6
@dave : could you provide pseudo code for ur approach
On 6 Jan 2014 07:39, Dave dave_and_da...@juno.com wrote:
Use a binary search. Assume that you have arrays a[m] and b[n] sorted in
ascending order. If a[i] is the kth smallest element, then b[k-i-2] must be
smaller than a[i], and b[k-i-1]
Use a binary search. Assume that you have arrays a[m] and b[n] sorted in
ascending order. If a[i] is the kth smallest element, then b[k-i-2] must be
smaller than a[i], and b[k-i-1] must be larger (assuming arrays are
zero-based). After using a binary search to find the value of i to meet
this