This is only a sketch: please help me improve it.
This solution will be based on using binary search to limit the search to n/2^i number of elements for each set, and I will use efficient data structures to remember those comparisons for the next number.
The first thing to note is that the balanced binary tree is good at performing binary search, only when the interval of the search closely match that of a (sub)tree.
The other 2 structures that accept binary search is the array and the skip list.
The array is inefficient for insertions and deletion, so the skip list seems the best choice.
We will need m arrays of size 64 that will contain the elements of each set per array that were compared in the binary search, inserted in the order of execution of the comparison.
We will also need a double linked list in which all the elements from all the sets that were used in the binary search will be inserted.
Using a skip list here minimizes even more the number of comparisons needed.
The basic idea is this.
- We search the minimum element in each set with a binary search.
- In each binary search step, we add the new element in the array of the set
and in the double linked list.
- Either there is a common minimum element or not.
- we remove the smallest element in the double linked list. New searches will start from the previous element in the binary search array of the set and will use half the distance than before.
we use the previous binary search elements in the arrays to limit the new search to the smallest known interval.
- continue to 1.