【leedcode】 Median of Two Sorted Arrays

 

https://leetcode.com/problems/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)).

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

真的很难
posted @ 2016-10-20 20:25  明将军  Views(121)  Comments(0Edit  收藏  举报
恨怨悲苦憎怒嗔、仁爱慈孝耻义廉。是故恨人所以得仁,无爱者必不怨,不慈者必无悲,孝而有苦,憎后耻来,义自怒生,廉人心嗔。夹天地七大苦,破人情七大碍,遂舍善恶之心,得称剑神。