Is 2(n+1) = O(2n)?
I believe that this one is correct because n+1 ~= n
.
Is 2(2n) = O(2n)?
This one seems like it would use the same logic, but I'm not sure.
First case is obviously true - you just multiply the constant C in by 2.
Current answers to the second part of the question, look like a handwaving to me, so I will try to give a proper math explanation. Let's assume that the second part is true, then from the definition of big-O, you have:
which is clearly wrong, because there is no such constant that satisfy such inequality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With