I'm learning about $P/NP$ and my friend used an example in which he said that if you have a triangle in an undirected graph which is basically a set of three nodes in which all pairs of nodes are connected by an edge, and $TRIANGLE = \{\langle G \rangle | G$ is an undirected graph that has a triangle $\}$. He says that $TRIANGLE$ is in $P$. In other words he says $TRIANGLE \in P$. But I don't understand why.
Thanks in advance for the help!
Here's pseudocode for an algorithm to determine whether a graph $(V,E)$ contains a triangle:
The inner loop is executed $|V|^3$ times, and even without clever data structures, checking whether some pair is in $E$ cannot take more than $O(n)$ time where $n$ is the size of the input, so the total running time is $O(n^4)$, at worst.