Function to find median of two sorted arrays
function findMedianSortedArrays ( & $ a , $ n , & $ b , $ m ) { global $ median , $ i , $ j ; $ min_index = 0 ; $ max_index = $ n ; while ( $ min_index <= $ max_index ) { $ i = intval ( ( $ min_index + $ max_index ) / 2 ) ; $ j = intval ( ( ( $ n + $ m + 1 ) / 2 ) - $ i ) ;