What is P?

P (polynomial time) are algorithms that are solvable in polynomial time only if the number of steps required to solve the problem has is an input in the form the form of O(n^k) and k is >= 0 and n is denonted by the complexity of the input, “p” time are considred fast, basic mathimatical opertations can be performed in “p” time such addition,subtraction, multiplication and even division

P Time Big-O Complexity Graph


What is NP?

Np (nondeterministic polynomial time) is actually refers to the set of problems that can be solved in “p” time by a non-deterministi Turing machine, a np problem is also classified if it can be checked in “p” time but no know solution can be generated in polynomial time and can be tested again a determinsitc Turing machine.

What about Np hard?

Np hard are the set of np problems which can be reduced to polynomial time with a deterministic Turing machine

and Np complete?

NP-complete is the intersection of NP-hard and NP. Equivalently, NP-complete is the class of decision problems in NP to which all other problems in NP can be reduced to in polynomial time by a deterministic Turing machine.

Euler Diagram Euler diagram for P, NP, NP-Complete, and NP-Hard set of problems.