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
Mathematically speaking, you would write O(4n²). It means that the complexity function of your algorithms behaves as n->4n² towards positive infinite.
But in computer science/algorithm, you would only write O(n²), which is sufficient to categorize your algorithm.