P-Type
The P-type consists of those problems that are solvable in polynomial time, i.e. these problems can be solved in time O(nk) in worst-case, where k is constant. These problems are called tractable, while others are called intractable.
NP-Type
The NP-type consists of those problems that are verifiable in polynomial time. NP is the class of decision problems for which it is easy to check the correctness of a claimed answer. This refers to set of problems whose solutions are hard to find but easy to verify.
In general, P-type or deterministic-polynomial-time algorithms k is expected to be less than n . Examples of polynomial time problems are :
- Basic operations like addition, subtraction, division, multiplication
- Hashtable lookup, string operations, sorting problems
- Shortest Path Algorithms; Djikstra, Bellman-Ford.
- Linear and Binary Search Algorithms.
Examples of -type problems are as follows :
- Traveling Salesman
- Knapsack
- Graph Coloring
- Timetable Scheduling
- Sum of subset, Longest common subsequence etc.
Lets explore the following videos to develop good understanding of P and NP type problems.
[Click the following links to watch the video]
You are invited to raise queries by writing your question in the box given below