Pseudo-Polynomial algorithm
What is a pseudo-polynomial?
The worst-case time complexity is called a pseudo-polynomial algorithm, depending on the input value (not the number of inputs).
For example, consider the problem of calculating the frequency of all elements in a positive array. a pseudo-polynomial time solution is to find the maximum value first, then iterate from 1 to the maximum value, and for each value, find its frequency in the array. The solution takes time based on the maximum value in the input array and is therefore a pseudo-polynomial. on the other hand, its time complexity is only based on the number of elements in an array (not a value) is considered to be a polynomial-time algorithm.
Pseudo-polynomial and NP-integrity
some NP-complete problems have pseudo-polynomial time solutions. For example,a dynamic programming solution for 0-1 knapsack , subset, and partitioning problems is pseudo-polynomial. The NP-complete problem that can be solved by using pseudo-polynomial time algorithm is called weak NP completion.
Pseudo-Polynomial algorithm