Ad

Tuesday, 25 June 2013

Algo#25: Find kth smallest from given 2 sorted array.

Finding kth smallest element from given 2 sorted array is not big deal if we are allowed to do it in O(K) or O(N+M). But what if you are asked to do it less than that. Can we use binary search technique to reduce complexity as given array are sorted !!

Following is implementation of above algorithm in c language.





Please write comments if you find anything wrong or you want to add something more related to this topic.

3 comments:

pavan said...
This comment has been removed by the author.
pavan said...

Can you please explain the concept behind the initialization of low and high?

pavan said...

Can you please explain the concept behind the initialization of low and high?

Post a Comment

Write your comment here.

Ad