Assuming some algorithm has a polynomial time complexity T(n), is it possible for any of the terms to have a negative coefficient? Intuitively, the answer seems like an obvious “No” since there is no part of any algorithm that reduces the existing amount of time taken by previous steps but I want to be certain.
Assuming some algorithm has a polynomial time complexity T(n) , is it possible for
Share
When talking about polynomial complexity, only the coefficient with the highest degree counts.
But I think you can have T(n) = n*n – n = n*(n-1). The n-1 would represent something you don’t do on the first or last iteration.
Anyway, the complexity would still be n*n.