Check wether the graph is bipartite after adding each edge

Правка en1, от kushb30, 2020-08-26 21:08:52

Given multiple inputs of the edges in a graph such as(first line being number of connections):

4 1 2 2 3 5 6 1 5

I have to check that after each input whether the graph remains bipartite or not, we will just break if graph is non-bipartite. I think this is some graph coloring problem but I am unable to implement it, please help me by providing some algorithm to do so.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский kushb30 2020-08-26 21:08:52 444 Initial revision (published)