public static void main(String[] args) {
        int[] x = {1, 3, 8, 9, 15};
        int[] y = {7, 11, 19, 21, 18, 25};

        MedianOfTwoSortedArrayOfDifferentLength mm = new MedianOfTwoSortedArrayOfDifferentLength();
        mm.findMedianSortedArrays(x, y);
    }
There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

Solution
Take minimum size of two array. Possible number of partitions are from 0 to m in m size array.
Try every cut in binary search way. When you cut first array at i then you cut second array at (m + n + 1)/2 - i
Now try to find the i where a[i-1] <= b[j] and b[j-1] <= a[i]. So this i is partition around which lies the median.

Time complexity is O(log(min(x,y))
Space complexity is O(1)

https://leetcode.com/problems/median-of-two-sorted-arrays/
https://discuss.leetcode.com/topic/4996/share-my-o-log-min-m-n-solution-with-explanation/4
src/com/interview/binarysearch/MedianOfTwoSortedArrayOfDifferentLength.java