To show that 2-colorable belongs to $\mathsf P$, I have a straightforward mental description in mind that I don't think will be considered as a formal proof. Hence I am interested to know how this must be said as an answer to this question. Here's what I think: Say we have 2 colors and n vertices. 2-coloring will be applied such that no two adjacent vertices have the same color. If a vertex is in color A, the other is B and so on. Is my reasoning correct?
Appendix: A graph G is said to be k-colourable if and only if a k-colouring of G exists.
A k-colouring is an assignment of k colours to the vertices of a graph G such that no edge joins two vertices of the same colour.
Best Answer
You have the idea, but "the other" what? One should present a more explicit algorithm and then investigate if it is polynomial. So, to elaborate your idea
Considering memory, a little refinement of the above can get along with one bit plus one pointer per vertex to realize the queue. Can you determine the time complexity of the algorithm?