$\mathsf{P}, \mathsf{NP}, \mathsf{PSPACE}, \mathsf{EXPTIME}$ etc. are all complexity classes. This means they contain problems, not algorithms. An algorithm can never be in $\mathsf{P}$, but if there's a polynomial-time algorithm solving a given problem $X$, then $X$ iscan be classified in complexity class $\mathsf{P}$. There could also be a bunch of other algorithms runs in different time complexity will also be able to solve the problem with the same input size under different time complexity, i.e. exponential-time algorithms accepting $X$, but since there already exists a single polynomial-time algorithm accepting $X$, it is in $\mathsf{P}$.
Clarify that the formalization of problems in binary outputs is only for decision problems (in the same sentence)
Fix the enumeration formatting; it was incorrectly labelled 1, 1, 2 instead of 1, 2, 3
Joey Eremondi
- 30.1k
- 5
- 66
- 122