# correct complexity notation

I have written an algorithm where the 2 input arguments are a file and a list of values. I would like to say the algorithm complexity is:

O(max{n,m}) where n is the size of the file and m is the length of the list


But maybe I'm mixing apples and oranges here. What is the correct way to write or express this?

Writing $O(m)+O(n)$ avoids the problem of having to address units. Note that $\max(m,n)$ and $m+n$ have the same order, and having max in a Landau symbol is quite uncommon.
• The standard way to write it is just $O(m+n)$. Units can be safely ignored. – Geoffrey Irving Oct 15 '12 at 15:53