Step1: Find Median in those two sorted arrays.
Step2: if k < (length of array1 + length of array2) / 2 then search again
for median - k
else median + k

Will this work?

On Thu, Nov 10, 2011 at 9:45 PM, shady <[email protected]> wrote:

> PS : there are duplicates also in both the arrays
>
> On Nov 10, 9:07 pm, shady <[email protected]> wrote:
> > Given two sorted arrays, how to find the kth smallest element in the
> > union of the arrays in a logarithmic time algorithm ?
> > i have already formed a recursive solution, can anyone give the
> > iterative approach, only pseudo-code :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Anup Ghatage

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to