kudeh
kudeh

Reputation: 913

Big Oh Analysis Result

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

Answers (1)

Salvador Dali
Salvador Dali

Reputation: 222441

Yes, it is. Big O ignores constants. So O(m +n) is the same as O(100000m + 50n)

Upvotes: 3

Related Questions