You must merge 2 sorted lists of
size m
and n
, respectively.
The number of comparisons needed in the worst case by the
merge algorithm will be:
m+n-1
mn
\max(m,n)
\min(m,n)
m+n
Each comparison puts one record in the final sorted array.
You don't compare when there is only one record.