d****n 发帖数: 130 | 1 time complexity: O(logn)
谁能给个程序吗? 多谢! | w****i 发帖数: 964 | 2 A rough idea, need to refine the a{m1:m2] part and consider the issue of a1[
m1:m2] and a2[m1:m2] length differs.
two_array_median (array1, array2){
m1 = median(a1)
m2 = median(a2)
if (m1
else return two_array_median(a1[m2:m1], a2[m2:m1])
} |
|