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:
Can you please explain the concept behind the initialization of low and high?
Can you please explain the concept behind the initialization of low and high?
Post a Comment
Write your comment here.