The class P
A decision problem is in the class P if there is an algorithm
that always gives the correct answer and has worst-case
running time of O(na) for a fixed a, where n is the size of
the input. An optimization problem is in the class P if the
corresponding decision problem of determining for every
input and given number c whether there is a solution with
score at least c is in the class P.