From 6980792eff787eb58023042f4103be4af3f5ab14 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 24 Jun 2020 22:44:37 +0000 Subject: [PATCH] formatting source-code for e6ab38c2fdd803ebc241cce2aeb7a28161ac259a --- graph/connected_components.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/graph/connected_components.cpp b/graph/connected_components.cpp index ab35f7587..efff4e4c7 100644 --- a/graph/connected_components.cpp +++ b/graph/connected_components.cpp @@ -2,7 +2,8 @@ * * \file * \brief [Connected Components - * (Connected Components)](https://en.wikipedia.org/wiki/Component_(graph_theory)) + * (Connected + * Components)](https://en.wikipedia.org/wiki/Component_(graph_theory)) * * \author [Ayaan Khan](http://github.com/ayaankhan98) * @@ -33,7 +34,7 @@ using std::vector; */ class graph { private: - /** \brief adj stores adjacency list representation of graph */ + /** \brief adj stores adjacency list representation of graph */ vector> adj; /** \brief keep track of connected components */ @@ -46,16 +47,16 @@ class graph { void explore(int, vector &); public: - /** + /** * \brief Constructor that intiliazes the graph on creation and set * the connected components to 0 */ explicit graph(int n) : adj(n, vector()) { connected_components = 0; } - + /** \brief Function to add a edge between two nodes or vertices of graph */ void addEdge(int, int); - /** + /** * \brief Function the calculates the connected compoents in the graph * by performing the depth first search on graph * @@ -110,14 +111,14 @@ void graph::explore(int u, vector &visited) { /** Main function */ int main() { - /// creating a graph with 4 vertex + /// creating a graph with 4 vertex graph g(4); - /// Adding edges between vertices + /// Adding edges between vertices g.addEdge(1, 2); g.addEdge(3, 2); - /// printing the connected components + /// printing the connected components std::cout << g.getConnectedComponents(); return 0; }