Yes:
You know that the element is inside the index [0,i] first list or [0,i] second list. Take the i/2 element from each list and compare. Continue in half.
I do not include the code because this problem is very similar to homework.
EDIT: Bisection is a binary search method. It works as follows:
Suppose i = 10; (zero indexing, we are looking for the 11th element as a whole).
In the first step, you know that the answer is either in list1 (0 ... 10) or in list2 (0 ... 10). Take a = list1 (5) and b = list2 (5).
If a> b, then in list 1 there are 5 elements that precede a and at least 6 elements in list2 that come before a. Thus, a is the upper bound of the result. Similarly, in list2 there are 5 elements that precede b and less than 6 elements in list1 that come before b. Thus, b is the lower bound of the result. Now we know that the result will be either in list1 (0..5) or in list2 (5..10). If a <b, then the result will be either in list1 (5..10), or in list2 (0..5). And if a == b, we have our answer (but the problem says that the elements are different, so a! = B).
We simply repeat this process, reducing the size of the search space in half at each step. Bisection refers to the fact that we select the middle element (bisector) from the range, which, as we know, includes the result.
So the only difference between this and binary searches is that in binary search we compare the value we are looking for, but here we compare the value with a list of others.
NOTE: this is actually O(log i) , which is better (at least not worse) than O(log n) . In addition, for the small self (maybe I <100), there would actually be fewer operations to combine the first elements of I (linear search instead of halving), since this is much simpler. When you add cache behavior and data locality, a linear search can be faster for I to several thousand.
In addition, if i> n, then rely on the fact that the result should be at the end of one of these lists, your initial range of candidates in each list is ((in) .. n)