Here is a brief introduction to the algorithm's time complexity and NP, after all, the analysis algorithm of time complexity of the upper bound to help analyze the quality of the algorithm, the analysis algorithm is also helpful to analyze whether there are better algorithms;
One, the complexity of time:
The general concern is also the time complexity of the recursive problem: ( reference:http://blog.csdn.net/so_geili/article/details/53444816)
Cases:
Second, NP problem:
P-Class problem : The decision problem can be solved by using deterministic algorithm in polynomial time;
NP class Problem : The decision problem can be solved by using non-deterministic algorithm in polynomial time;
NPC Problem (NP-complete problem): The complexity of some problems in NP is associated with the complexity of the entire class. Any of these problems if there is a polynomial-time algorithm, then all NP problems are polynomial time solvable;
Note: (1) The time of the polynomial time here is for the scale of the problem;
(2) We will be able to solve the problem in polynomial time called "easy" problem, will need to solve the problem in exponential time called "difficult" problem;
(3) From the definition is easy to find that p belongs to NP, but P is not a true subset of NP, this problem is currently one of the seven major problems in the world;
(4) The definition of a problem can be found in the following example:
Brief introduction of algorithm time complexity and NP problem