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
It's O(n^2). Constant factors "move into the O". You only keep the largest exponent since this is the one dominating. And you can leave out coefficients since when comparing different algorithms even very large coefficients result in smaller total numbers than having a larger exponent (with n large enough).