What does it mean when someone says that the code is polynomial in n
? And then how does one make sure that his code is polynomial in n
?
Asked
Active
Viewed 185 times
0

Peter Wood
- 23,859
- 5
- 60
- 99

Naz
- 2,012
- 1
- 21
- 45
-
Hard to know the context in which that was said, but in all probability the person is referring to the [time complexity](https://en.wikipedia.org/wiki/Time_complexity) of the code. Very roughly, "polynomial in n" would mean that given an input of size n, the code will run in at most a constant factor of n^2 (or n^k where k is any positive integer) time. – Alex Riley Nov 04 '15 at 12:35
-
1https://en.wikipedia.org/wiki/Time_complexity#Polynomial_time – Peter Wood Nov 04 '15 at 12:44
-
This isn't to do with [tag:python]. – Peter Wood Nov 04 '15 at 12:45
-
I wasn't sure which tag to use. – Naz Nov 04 '15 at 12:46
-
thank you @ajcr. I will check it out Peter – Naz Nov 04 '15 at 12:48