- A complexity class is a set of languages, membership in which is determined by a complexity measure (e.g., running time) on an algorithm that determines whether a given string belongs to a language.

P = {L {0, 1}* there exists an algorithm A that decides L in polynomial time}

P = {L L is accepted by a polynomial time algorithm}

**Proof:**

There exists an algorithm A' that runs algorithm A for a polynomial amount of time and rejects if A has not yet accepted the string; otherwise accepts.