fix: linter and spacing for is_graph_bipartite.

This commit is contained in:
Filip Hlásek 2020-08-16 12:27:51 -07:00
parent 5aa074c88b
commit a49ec9b8d7

View File

@ -56,7 +56,6 @@ namespace graph{
static const int nax = 5e5 + 1; static const int nax = 5e5 + 1;
public: public:
/** /**
* @brief Constructor that initializes the graph on creation * @brief Constructor that initializes the graph on creation
@ -70,7 +69,6 @@ namespace graph{
void addEdge(int u, int v); /// function to add edges to our graph void addEdge(int u, int v); /// function to add edges to our graph
bool is_bipartite(); /// function to check whether the graph is bipartite or not bool is_bipartite(); /// function to check whether the graph is bipartite or not
}; };
/** /**
* @brief Function that add an edge between two nodes or vertices of graph * @brief Function that add an edge between two nodes or vertices of graph
@ -98,8 +96,7 @@ namespace graph{
bool Graph::is_bipartite(){ bool Graph::is_bipartite(){
bool check = true; bool check = true;
std::queue<int> q; std::queue<int> q;
for (int current_edge = 0; current_edge < n; ++current_edge) for (int current_edge = 0; current_edge < n; ++current_edge) {
{
if (side[current_edge] == -1){ if (side[current_edge] == -1){
q.push(current_edge); q.push(current_edge);
side[current_edge] = 0; side[current_edge] = 0;
@ -120,8 +117,8 @@ namespace graph{
} }
return check; return check;
} }
} /// namespace is_graph_bipartite } // namespace is_graph_bipartite
} /// namespace graph } // namespace graph
/** /**
* Function to test the above algorithm * Function to test the above algorithm
* @returns none * @returns none