mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-05 03:29:46 +08:00
fix: add <cstdint> to graph/**
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <cassert> /// for assert
|
||||
#include <cstdint> /// for integral typedefs
|
||||
#include <iostream> /// for io operations
|
||||
#include <limits> /// for variable INF
|
||||
#include <queue> /// for the priority_queue of distances
|
||||
|
||||
@@ -3,20 +3,24 @@
|
||||
* @brief [Disjoint union](https://en.wikipedia.org/wiki/Disjoint_union)
|
||||
*
|
||||
* @details
|
||||
* The Disjoint union is the technique to find connected component in graph efficiently.
|
||||
* The Disjoint union is the technique to find connected component in graph
|
||||
* efficiently.
|
||||
*
|
||||
* ### Algorithm
|
||||
* In Graph, if you have to find out the number of connected components, there are 2 options
|
||||
* In Graph, if you have to find out the number of connected components, there
|
||||
* are 2 options
|
||||
* 1. Depth first search
|
||||
* 2. Disjoint union
|
||||
* 1st option is inefficient, Disjoint union is the most optimal way to find this.
|
||||
* 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 <iostream> /// for IO operations
|
||||
#include <set> /// for std::set
|
||||
#include <vector> /// for std::vector
|
||||
#include <cstdint> /// for integer typedefs
|
||||
#include <iostream> /// for IO operations
|
||||
#include <set> /// for std::set
|
||||
#include <vector> /// for std::vector
|
||||
|
||||
/**
|
||||
* @namespace graph
|
||||
@@ -25,7 +29,8 @@
|
||||
namespace graph {
|
||||
/**
|
||||
* @namespace disjoint_union
|
||||
* @brief Functions for [Disjoint union](https://en.wikipedia.org/wiki/Disjoint_union) implementation
|
||||
* @brief Functions for [Disjoint
|
||||
* union](https://en.wikipedia.org/wiki/Disjoint_union) implementation
|
||||
*/
|
||||
namespace disjoint_union {
|
||||
uint32_t number_of_nodes = 0; // denotes number of nodes
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cstdint> /// for integral typedefs
|
||||
#include <iostream> // for std::cout
|
||||
#include <map> // for std::map
|
||||
#include <queue> // for std::queue
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* @author [tushar2407](https://github.com/tushar2407)
|
||||
*/
|
||||
#include <cassert> /// for assert
|
||||
#include <cstdint> /// for integral typedefs
|
||||
#include <iostream> /// for IO operations
|
||||
#include <queue> /// for queue data structure
|
||||
#include <vector> /// for vector data structure
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <algorithm> /// for std::min
|
||||
#include <cassert> /// for assert
|
||||
#include <cstdint> /// for integral typedefs
|
||||
#include <iostream> /// for IO operations
|
||||
#include <limits> /// for limits of integral types
|
||||
#include <vector> /// for std::vector
|
||||
|
||||
Reference in New Issue
Block a user