Given two ordered arrays of size and nums1 m and n nums2.
Please find both the median and orderly array, and requires time complexity of the algorithm is O (log (m + n) ).
You can not assume nums1 and nums2 both empty.
Example. 1:
nums1 = [. 1, 3]
nums2 = [2]
, the median is 2.0
Example 2:
nums1 = [. 1, 2]
nums2 = [3,. 4]
, the median is (2 + 3) / 2 = 2.5
LeetCode_4-- find the median two ordered arrays
Guess you like
Origin www.cnblogs.com/echola/p/11009495.html
Ranking