mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
somemore cpplint fixing
This commit is contained in:
parent
4c6c1dbe40
commit
cd9f5cd584
@ -5,13 +5,13 @@ using std::vector;
|
||||
|
||||
class graph {
|
||||
private:
|
||||
vector<vector<int>> adj;
|
||||
int connected_components;
|
||||
void depth_first_search();
|
||||
void explore(int, vector<bool>&);
|
||||
vector<vector<int>> adj;
|
||||
int connected_components;
|
||||
void depth_first_search();
|
||||
void explore(int, vector<bool>&);
|
||||
public:
|
||||
graph(int n): adj(n, vector<int>()) {
|
||||
connected_components = 0;
|
||||
graph(int n): adj(n, vector<int>()) {
|
||||
connected_components = 0;
|
||||
}
|
||||
void addEdge(int, int);
|
||||
int getConnectedComponents() {
|
||||
@ -48,8 +48,8 @@ void graph::explore(int u, vector<bool> &visited) {
|
||||
|
||||
int main() {
|
||||
graph g(4);
|
||||
g.addEdge(1,2);
|
||||
g.addEdge(3,2);
|
||||
g.addEdge(1, 2);
|
||||
g.addEdge(3, 2);
|
||||
std::cout << g.getConnectedComponents();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user