aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp/dsa/DisjointSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'meowpp/dsa/DisjointSet.h')
-rw-r--r--meowpp/dsa/DisjointSet.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/meowpp/dsa/DisjointSet.h b/meowpp/dsa/DisjointSet.h
index 1ea6d97..b33a839 100644
--- a/meowpp/dsa/DisjointSet.h
+++ b/meowpp/dsa/DisjointSet.h
@@ -24,6 +24,32 @@ namespace meow{
void reset(size_t _n );
size_t merge(size_t a, size_t b);
};
+ /*********************************************************
+ @asciidoc
+ === meow:: *DisjointSet* (C++ class)
+ .Description
+ `DisjointSet` is a lighting data structure that maintain N numbers from
+ *0* to *N-1* with methods below:
+
+ [options="header",width="100%",cols="1>,1<s,5<,1<,1<,10<",grid="rows"]
+ |=======================================================================
+ |Const?|Name| Parameters| Return Type| Time Complexity| Description
+ |const|root|(size_t number)|size_t|very fast|
+ Return the *group id* of the number given
+ |const|size|()|size_t|very fast|
+ Return *N*
+ ||reset|(size_t N)|void|very fast|
+ Clean and initalize
+ ||merge|(size_t number1, +
+ size_t number2)|size_t|very fast|
+ *Union* the group contains number1 and the group contains number2.
+ Return the merged group id
+ |=======================================================================
+NOTE: *very fast* means that you can consider it as constant time.
+
+'''
+@asciidoc-
+ *********************************************************/
}
#include "DisjointSet.hpp"