News for hackers. Stuff that matters.
Re:Big-O notation explained by a self-taught programmer by oskarkv on Saturday July 27, 2013 @03:41AM (#6112151)
Of course O(n) is not equal to O(n^2). O(n) is a set, and O(n^2) is a different set.
Re:Big-O notation explained by a self-taught programmer by fmax30 on Saturday July 27, 2013 @07:24AM (#6112538)
Big O is a upper bound , what I meant was that if a piece of code has O(n) then it also has O(n^2). With emphasis on the upper bound f(x) = O(g(x)) if f(x) <= cg(x).

so my point is if f(N) = O(N) then f(N) is also equal to O(N^2) as f(N) <= CN^2 .