mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix: linter and spacing for is_graph_bipartite.
This commit is contained in:
parent
5aa074c88b
commit
a49ec9b8d7
@ -56,7 +56,6 @@ namespace graph{
|
||||
|
||||
static const int nax = 5e5 + 1;
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* @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
|
||||
|
||||
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
|
||||
@ -98,8 +96,7 @@ namespace graph{
|
||||
bool Graph::is_bipartite(){
|
||||
bool check = true;
|
||||
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){
|
||||
q.push(current_edge);
|
||||
side[current_edge] = 0;
|
||||
@ -120,8 +117,8 @@ namespace graph{
|
||||
}
|
||||
return check;
|
||||
}
|
||||
} /// namespace is_graph_bipartite
|
||||
} /// namespace graph
|
||||
} // namespace is_graph_bipartite
|
||||
} // namespace graph
|
||||
/**
|
||||
* Function to test the above algorithm
|
||||
* @returns none
|
||||
|
Loading…
Reference in New Issue
Block a user