题目
Median of Two Sorted Arrays
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)).
很容易想到是用分治来做,但是我自己在写代码的时候,讨论奇偶和最后终止时的边界实在是太烦了,写出来我自己都看不下去,肯定有更简单的办法。于是翻了翻大神们的答案,有下面这样一个解法。