If I have an algorithm that takes 4n^2 + 7n moves to accomplish, what is its O? O(4n^2)? O(n^2)?
I know that 7n is cut off, but I don\'t know if I should keep the n^2 c
A statement like
4n² + 7n = O(n²)
means that for some constant multiplier c, the expression cn² will eventually overtake 4n² + 7n. It's technically not incorrect to leave the coefficient in there — O(n²) and O(4n²) mean the exact same thing, because any constant c for the former can be replaced by c/4 for the latter. However, such a thing is less clear, possibly misleading, and definitely nonstandard.