Reputation: 913
I just formulated an algorithm for a problem and I analysed it to be O(2m+n) but we are supposed to get O(m+n) so I want to know if O(2m+n) = O(m+n).
Upvotes: 0
Views: 51
Reputation: 222441
Yes, it is. Big O ignores constants. So O(m +n)
is the same as O(100000m + 50n)
Upvotes: 3