Time complexity O(m+n) Vs O(n) Consider this algorithm iterating over 2 arrays (A and B)
size of A = n
size of B = m
Please note that m &lt;= n
The algorithm is as follows
for every value in A:
    // code

for every value in B:
    // code

The time complexity of this algorithm is O(n+m)
But given that m is strictly lesser than or equal to n, can this be considered as O(n)?
Yes:
$n+m \le n+n=2n$ which is $O(n)$, and thus $O(n+m)=O(n)$

For clarity, this is true only under the assumption that $m\le n$. Without this assumption, $O(n)$ and $O(n+m)$ are two different things - so it would be important to write $O(n+m)$ instead of $O(n)$.