What are the maximum possible sizes for the input arrays? (Determines if an O(n+m) linear scan is acceptable or if O(\log(\min(n, m))) is required).
Can the input arrays be empty? If both are empty, what is the expected return value?
Are the elements guaranteed to be within the range of a standard integer, and should the median be returned as a double?
Are the arrays sorted in non-decreasing order?
Assumptions:
Arrays are sorted in non-decreasing order.
One array might be empty, but not both.
Time complexity must be O(\log(\min(n, m))) to satisfy competitive programming standards for this classic problem.
Median is the middle element for odd total length, and the average of the two middle elements for even total length.