We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

Here is the formal definition of Big-O:
f(n) = O(g(n)) means there are positive constants c and k, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ k.
So,saying that there is no such thing as O(2xN) is wrong.
Although, you may say that O(N)=O(2xN).

## Candies

You are viewing a single comment's thread. Return to all comments →

No such thing as O(2xN), it is simply a O(N) solution

Here is the formal definition of Big-O:

f(n) = O(g(n)) means there are positive constants c and k, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ k.So,saying that there is no such thing as O(2xN) is wrong. Although, you may say that O(N)=O(2xN).Formally g(n) could be g(n)=2*n. Therefore it's correct to say O(2*n). And we all know, O(2*n)=O(n). Both is correct.

That's what I said