Maintain the invaraint : i + j = k -1

if B[j-1] < A[i] < B[j], then A[i] must be the kth smallest
else if A[i-1] < B[j] < A[i], then B[j] must be the kth smallest

If the above conditions are not satisfied, subdivide the arrays.


On Thu, Jun 13, 2013 at 1:41 PM, sourabh jain <wsour...@gmail.com> wrote:

> its same as finding a median of two sorted arrays only.
> http://www.geeksforgeeks.org/median-of-two-sorted-arrays/
>
>
> On Sun, Jun 9, 2013 at 4:49 PM, rahul sharma <rahul23111...@gmail.com>wrote:
>
>> Please suggest logm+logn aproach...
>> can be easily done in o(k)
>>
>>
>> How to do in logm +logn
>>
>> plz suggest algo
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to algogeeks+unsubscr...@googlegroups.com.
>>
>>
>>
>
>
>
> --
> Regards,
> Sourabh Kumar Jain
> +91-8971547841
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Reply via email to