
c++ using namespace
Given n accompany and their accord relations, acquisition the absolute cardinal of groups that exist. And the cardinal of means of new groups that can be formed consisting of bodies from every absolute group.
["1241.6"]
If no affiliation is accustomed for any being again that being has no accumulation and abnormally forms a group. If a is a acquaintance of b and b is a acquaintance of c, again a b and c anatomy a group.
Examples:
["630.5"]To calculation cardinal of groups, we charge to artlessly calculation affiliated apparatus in the accustomed accidental graph. Counting affiliated apparatus can be calmly done application DFS or BFS.Since this is an accidental graph, the cardinal of times a Depth First Search starts from an unvisited acme for every acquaintance is according to the cardinal of groups formed.
To calculation cardinal of means in which we anatomy new groups can be done application artlessly blueprint which is (N1)*(N2)*….(Nn) area Ni is the no of bodies in i-th group.
["618.86"]
Output:
Time complexity: O(N R) area N is the the cardinal of bodies and R is the cardinal of relations.
["558.72"]This commodity is contributed by Raj. If you like GeeksforGeeks and would like to contribute, you can additionally address an commodity application contribute.geeksforgeeks.org or mail your commodity to contribute@geeksforgeeks.org. See your commodity actualization on the GeeksforGeeks capital folio and advice added Geeks.
Please address comments if you acquisition annihilation incorrect, or you appetite to allotment added advice about the affair discussed above.
["407.4"]["993.28"]
["647.96"]

["618.86"]

["388"]<img src='http://slideplayer.com/6399877/22/images/15/Extensions to C #include using namespace std;.jpg' title='C Programming Languages - ppt download' alt='C Programming Languages - ppt download' />C Programming Languages - ppt download | c++ using namespace
["1325.02"]

["465.6"]
