Understanding Polynomial Time Complexity

AI Thread Summary
Exponential time algorithms take time proportional to Θ(a^n) for some constant a, indicating that their running time grows rapidly with input size. In contrast, polynomial time algorithms operate within Θ(P(n)), where P is a polynomial function of the input size. A common example of polynomial time is illustrated through nested loops, where the time complexity can be expressed as n^2. Understanding these concepts is crucial for analyzing algorithm efficiency. The discussion emphasizes the importance of recognizing the differences between exponential and polynomial time complexities in algorithm design.
teng125
Messages
416
Reaction score
0
can sombody pls explain to me what does exponential time algorithm means??

thanx
 
Physics news on Phys.org
it is just some very basic computer question which is algorithm.It is not a programming problem.
It means an algorithm which take exponential time to complete and another type is it takes polynomial time to compete an algorithm.

Therefore,i do not understand what it means by exponential time and polynomial time
 
If an algorithm takes exponential time, that usually means that it can be done in
\Theta (a^n) time for some constant a.
If an algorithm takes polynomial time, that usually means it can be done in
\Theta (P(n)) time for some polynomial P.
Are you familiar with \Theta, O, or \Omega notation?
 
Just to show a quick example of polynomial time. Say you have two nested for loops,
for (i=1; i<n; i++) {
for (j=1; j<n; j++) {}
}

we can see that j goes to n as i = 1, then j goes to n as i = 2...you see a pattern? j goes to n, n times. Thus our running running time is
n * n ...which also happens to be n^2...this is what is meant by polynomial time..a run time that can be expressed in polynomial form..a_nx^n + a_{n-1}x^{n-1} + \cdots + a_0
 
Back
Top