Consider the following statements:
- Checking if a given $undirected$ graph has a cycle is in $\mathsf{P}$
- Checking if a given $undirected$ graph has a cycle is in $\mathsf{NP}$
- Checking if a given $directed$ graph has a cycle is in $\mathsf{P}$
- Checking if a given $directed$ graph has a cycle is in $\mathsf{NP}$
Which of the above statements is/are TRUE? Choose from the following options.
- Only i and ii
- Only ii and iv
- Only ii, iii, and iv
- Only i, ii and iv
- All of them