From 796c44f99353bf659976f6fde1861ee2b6746e03 Mon Sep 17 00:00:00 2001 From: Sagar Pandya Date: Thu, 14 Jan 2021 20:10:17 +0530 Subject: [PATCH] author name added and minor documentation fixed --- graph/connected_components_with_dsu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/graph/connected_components_with_dsu.cpp b/graph/connected_components_with_dsu.cpp index 4ce2de73a..e956ada85 100644 --- a/graph/connected_components_with_dsu.cpp +++ b/graph/connected_components_with_dsu.cpp @@ -10,6 +10,9 @@ * 1. Depth first search * 2. Disjoint union * 1st option is inefficient, Disjoint union is the most optimal way to find this. + * + * @author Unknown author + * @author [Sagar Pandya](https://github.com/sagarpandyansit) */ #include /// for IO operations #include /// for std::set @@ -79,8 +82,9 @@ uint32_t no_of_connected_components() { for (uint32_t i = 1; i <= number_of_nodes; i++) temp.insert(find_set(i)); return temp.size(); // return the size of temp set } -} // namespace disjoint_union -} // namespace graph +} // namespace disjoint_union +} // namespace graph + /** * @brief Test Implementations * @returns void @@ -100,6 +104,7 @@ static void test() { } std::cout << dsu::no_of_connected_components() << std::endl; } + /** * @brief Main function * @returns 0 on exit