Median of 2 sorted arrays of different lengths
问题 How can one find a median of 2 sorted arrays A and B which are of length m and n respectively. I have searched, but most the algorithms assume that both arrays are of same size. I want to know how can we find median if m != n consider example, A={1, 3, 5, 7, 11, 15} where m = 6, B={2, 4, 8, 12, 14} where n = 5 and the median is 7 Any help is appreciated. I am preparing for interviews and i am struggling with this algo right now. 回答1: Here is the JAVA code to find the median of two sorted