题目:
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)).
Solutions(1):
//简单的,直接合并两个有序数组(类似归并排序),找出中间值即可。
复杂度应该为O(n+m),但也通过了LeetCode测试。
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int i =0;
int j =0;
int k =0;