In this article, we’ll see how to find the kth-smallest element in the union of two sorted arrays.
First, we’ll define the exact problem. Second, we’ll see two inefficient but straightforward solutions. Third, we’ll look at an efficient solution based on a binary search on the two arrays. Finally, we’ll look at some tests to verify that our algorithm works.
#algorithms #smallest