Question: In JAVA Given two sorted arrays nums 1 and nums 2 of size m and n respectively, return the median of the two sorted arrays.

In JAVA Given two sorted arrays nums 1 and nums 2 ofIn JAVA

Given two sorted arrays nums 1 and nums 2 of size m and n respectively, return the median of the two sorted arrays. Example 1: Input: nums 1=[1,3], nums 2=[2] Output: 2.00000 Explanation: merged array =[1,2,3] and median is 2 . Example 2: Input: nums 1=[1,2], nums 2=[3,4] Output: 2.50000 Explanation: merged array =[1,2,3,4] and median is (2+3)/2=2.5. class Solution \{ public double findMedianSortedArrays(int[] nums1, int[] nums2) \{ // Your code here \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!