CPP
CPP copied to clipboard
Median of two Sorted Arrays
Given two sorted arrays A and B of sizes n, m respectively. Find the median of these two arrays in O(1) space i.e. find the median without actually merging the two arrays.
Input Format First line contains two integers - n, m Next two lines contain n and m integers respectively.
Output Format Single integer denoting the median of the given arrays.
Sample Input
3
4
1 3 6
2 4 8 10
Sample Output
4
Explanation
Array - 1 2 3 4 6 8 10
Median - 4
Sample Input
4
4
1 3 6 9
2 4 8 10
Sample Output
5
Explanation
Array - 1 2 3 4 6 8 9 10
Median - (4+6)/2 = 5
Add code in the Interview Questions repo.
I want to try this.
I would like to work on this.
Can I work on this as a part of hacktober fest 2020. please assign .
Hello @pranjalibajpai can you please assign this issue?
may I work on this issue pls.