somemore cpplint fixing

This commit is contained in:
Ayaan Khan 2020-05-18 16:57:00 +05:30
parent 4c6c1dbe40
commit cd9f5cd584

View File

@ -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;
}