disjoint-set

- Blogathon, Blogathon-2021, disjoint-set, Graph, Mathematical, union-find

Maximum element in connected component of given node for Q queries

  #include using namespace std;  int Find(vector& parent, int a){    return parent[a] = (parent[a] == a)                           ? a                           : (Find(parent, parent[a]));}  void Union(vector& parent,           vector& rank,           vector& maxValue,           int…

Read More