diff --git a/annotated.html b/annotated.html index ea857a33d..47bd65bc4 100644 --- a/annotated.html +++ b/annotated.html @@ -198,41 +198,42 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();  Cbst_nodeA struct to represent a node in the Binary Search Tree  CBtree  Ccll - Ccompare - CCompareComparator class for priority queue + CCompareComparator class for priority queue + Ccompare  CComplexClass Complex to represent complex numbers as a field  CCycleCheck  Cdouble_linked_list - CEasterYearMonthDayFor IO operations - CEdge - CFCFSClass which implements the FCFS scheduling algorithm - CFenwickTree - CGraph - Chash_chainChain class with a given modulus - CItem - Clarge_number - Clinkedlist - Clist - CMinHeap - CMinHeapNode - Cmst - Cnode + CdsuDisjoint sets union data structure, class based representation + CEasterYearMonthDayFor IO operations + CEdge + CFCFSClass which implements the FCFS scheduling algorithm + CFenwickTree + CGraph + Chash_chainChain class with a given modulus + CItem + Clarge_number + Clinkedlist + Clist + CMinHeap + CMinHeapNode + Cmst  CNode - CPoint - Cquery - CQueue - Cqueue - CRBtree - CSegmentIntersection - CSolution - Cstack - Cstack_linkedList - CTestCasesClass encapsulating the necessary test cases - Ctower - CTrie - CTrieNode - Cuint128_tClass for 128-bit unsigned integer - Cuint256_tClass for 256-bit unsigned integer + Cnode + CPoint + Cquery + CQueue + Cqueue + CRBtree + CSegmentIntersection + CSolution + Cstack + Cstack_linkedList + CTestCasesClass encapsulating the necessary test cases + Ctower + CTrie + CTrieNode + Cuint128_tClass for 128-bit unsigned integer + Cuint256_tClass for 256-bit unsigned integer diff --git a/annotated_dup.js b/annotated_dup.js index ff673b2e9..8e76be849 100644 --- a/annotated_dup.js +++ b/annotated_dup.js @@ -137,11 +137,12 @@ var annotated_dup = [ "binary_search_tree", "d9/dde/classbinary__search__tree.html", "d9/dde/classbinary__search__tree" ], [ "Btree", "d9/d90/struct_btree.html", null ], [ "cll", "d5/d15/classcll.html", null ], - [ "compare", "d1/db3/structcompare.html", null ], [ "Compare", "de/d4a/class_compare.html", "de/d4a/class_compare" ], + [ "compare", "d1/db3/structcompare.html", null ], [ "Complex", "da/d5a/class_complex.html", "da/d5a/class_complex" ], [ "CycleCheck", "d3/dbb/class_cycle_check.html", "d3/dbb/class_cycle_check" ], [ "double_linked_list", "d9/dee/classdouble__linked__list.html", null ], + [ "dsu", "dd/d1f/classdsu.html", "dd/d1f/classdsu" ], [ "EasterYearMonthDay", "d1/df6/class_easter_year_month_day.html", "d1/df6/class_easter_year_month_day" ], [ "Edge", "d7/d77/class_edge.html", "d7/d77/class_edge" ], [ "FCFS", "dd/dca/class_f_c_f_s.html", "dd/dca/class_f_c_f_s" ], @@ -155,8 +156,8 @@ var annotated_dup = [ "MinHeap", "d2/d05/class_min_heap.html", "d2/d05/class_min_heap" ], [ "MinHeapNode", "d5/d29/struct_min_heap_node.html", null ], [ "mst", "d1/d77/structmst.html", null ], - [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], [ "Node", "db/d8b/struct_node.html", null ], + [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], [ "Point", "d8/dc8/struct_point.html", "d8/dc8/struct_point" ], [ "query", "dd/d1b/structquery.html", null ], [ "Queue", "dc/db5/struct_queue.html", null ], diff --git a/classes.html b/classes.html index 0ff442eee..4795117d0 100644 --- a/classes.html +++ b/classes.html @@ -103,10 +103,10 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); })
binary_search_tree
BinaryTree (operations_on_datastructures::reverse_binary_tree)
BinaryTree (others::iterative_tree_traversals)
binary_search_tree::bst_node
Btree
C
-
cll
compare
Compare
AyStarSearch::comparison_operator (machine_learning::aystar_search)
Complex
Convexhull (geometry::jarvis)
CycleCheck
+
cll
Compare
compare
AyStarSearch::comparison_operator (machine_learning::aystar_search)
Complex
Convexhull (geometry::jarvis)
CycleCheck
D
-
DenseLayer (machine_learning::neural_network::layers)
double_linked_list
+
DenseLayer (machine_learning::neural_network::layers)
double_linked_list
dsu
E
EasterYearMonthDay
Edge
EightPuzzle (machine_learning::aystar_search)
Entry (double_hashing)
Entry (linear_probing)
Entry (quadratic_probing)
@@ -130,7 +130,7 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); })
MinHeap
MinHeapNode
mst
N
-
NCRModuloP (math::ncr_modulo_p)
NeuralNetwork (machine_learning::neural_network)
Node (data_structures::linked_list)
Node (data_structures)
Node (data_structures::tree_234)
Trie::Node (data_structures::trie_using_hashmap)
node
Node
Node (operations_on_datastructures::inorder_traversal_of_bst)
Node (operations_on_datastructures::reverse_binary_tree)
Node (others::iterative_tree_traversals)
perSegTree::Node (range_queries)
Node (search::sublist_search)
+
NCRModuloP (math::ncr_modulo_p)
NeuralNetwork (machine_learning::neural_network)
Node (data_structures::linked_list)
Node (data_structures)
Node (data_structures::tree_234)
Trie::Node (data_structures::trie_using_hashmap)
Node
node
Node (operations_on_datastructures::inorder_traversal_of_bst)
Node (operations_on_datastructures::reverse_binary_tree)
Node (others::iterative_tree_traversals)
perSegTree::Node (range_queries)
Node (search::sublist_search)
P
perSegTree (range_queries)
Point (ciphers::elliptic_curve_key_exchange)
Point (geometry::jarvis)
Point
diff --git a/d0/dcb/classdsu-members.html b/d0/dcb/classdsu-members.html new file mode 100644 index 000000000..ce1fa86dd --- /dev/null +++ b/d0/dcb/classdsu-members.html @@ -0,0 +1,126 @@ + + + + + + + +Algorithms_in_C++: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C++ 1.0.0 +
+
Set of algorithms implemented in C++.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
dsu Member List
+
+
+ +

This is the complete list of members for dsu, including all inherited members.

+ + + + + + + + + + + + + + + + + + + +
depthdsuprivate
dsu(uint64_t n)dsuinlineexplicit
dsu(uint64_t n)dsuinlineexplicit
findSet(uint64_t i)dsuinline
findSet(uint64_t i)dsuinline
get(uint64_t i)dsuinline
get_max(uint64_t i)dsuinline
get_min(uint64_t i)dsuinline
getParents(uint64_t i)dsuinline
isSame(uint64_t i, uint64_t j)dsuinline
isSame(uint64_t i, uint64_t j)dsuinline
maxElementdsuprivate
minElementdsuprivate
pdsuprivate
setSizedsuprivate
size(uint64_t i)dsuinline
unionSet(uint64_t i, uint64_t j)dsuinline
UnionSet(uint64_t i, uint64_t j)dsuinline
+
+ + + + diff --git a/d3/dae/dsu__path__compression_8cpp.html b/d3/dae/dsu__path__compression_8cpp.html new file mode 100644 index 000000000..031a15c60 --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp.html @@ -0,0 +1,289 @@ + + + + + + + +Algorithms_in_C++: data_structures/dsu_path_compression.cpp File Reference + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Algorithms_in_C++ 1.0.0 +
+
Set of algorithms implemented in C++.
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
dsu_path_compression.cpp File Reference
+
+
+ +

DSU (Disjoint sets) +More...

+
#include <cassert>
+#include <iostream>
+#include <vector>
+
+Include dependency graph for dsu_path_compression.cpp:
+
+
+
+
+
+ + + + +

+Classes

class  dsu
 Disjoint sets union data structure, class based representation. More...
 
+ + + + + + + + + + +

+Functions

static void test1 ()
 Self-test implementations, 1st test. More...
 
static void test2 ()
 Self-implementations, 2nd test. More...
 
int main ()
 Main function. More...
 
+

Detailed Description

+

DSU (Disjoint sets)

+

It is a very powerful data structure that keeps track of different clusters(sets) of elements, these sets are disjoint(doesnot have a common element). Disjoint sets uses cases : for finding connected components in a graph, used in Kruskal's algorithm for finding Minimum Spanning tree. Operations that can be performed: 1) UnionSet(i,j): add(element i and j to the set) 2) findSet(i): returns the representative of the set to which i belogngs to. 3) get_max(i),get_min(i) : returns the maximum and minimum Below is the class-based approach which uses the heuristic of path compression. Using path compression in findSet(i),we are able to get to the representative of i in O(1) time.

Author
AayushVyasKIIT
+
See also
dsu_union_rank.cpp
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + + +
int main (void )
+
+ +

Main function.

+
Returns
0 on exit
+

< number of items

+

< object of class disjoint sets

+
205 {
+
206 uint64_t n = 10; ///< number of items
+
207 dsu d(n + 1); ///< object of class disjoint sets
+
208
+
209 test1(); // run 1st test case
+
210 test2(); // run 2nd test case
+
211
+
212 return 0;
+
213}
+
Disjoint sets union data structure, class based representation.
Definition: dsu_path_compression.cpp:33
+
static void test2()
Self-implementations, 2nd test.
Definition: dsu_path_compression.cpp:186
+
static void test1()
Self-test implementations, 1st test.
Definition: dsu_path_compression.cpp:169
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test1()

+ +
+
+ + + + + +
+ + + + + + + +
static void test1 ()
+
+static
+
+ +

Self-test implementations, 1st test.

+
Returns
void
+

< number of items

+

< object of class disjoint sets

+
169 {
+
170 // the minimum, maximum, and size of the set
+
171 uint64_t n = 10; ///< number of items
+
172 dsu d(n + 1); ///< object of class disjoint sets
+
173 // set 1
+
174 d.UnionSet(1, 2); // performs union operation on 1 and 2
+
175 d.UnionSet(1, 4); // performs union operation on 1 and 4
+
176 vector<uint64_t> ans = {1, 4, 3};
+
177 for (uint64_t i = 0; i < ans.size(); i++) {
+
178 assert(d.get(4).at(i) == ans[i]); // makes sure algorithm works fine
+
179 }
+
180 cout << "1st test passed!" << endl;
+
181}
+ +
#define endl
Definition: matrix_exponentiation.cpp:36
+
ll ans(ll n)
Definition: matrix_exponentiation.cpp:91
+ +
+Here is the call graph for this function:
+
+
+
+
+ +
+
+ +

◆ test2()

+ +
+
+ + + + + +
+ + + + + + + +
static void test2 ()
+
+static
+
+ +

Self-implementations, 2nd test.

+
Returns
void
+

< number of items

+

< object of class disjoint sets

+
186 {
+
187 // the minimum, maximum, and size of the set
+
188 uint64_t n = 10; ///< number of items
+
189 dsu d(n + 1); ///< object of class disjoint sets
+
190 // set 1
+
191 d.UnionSet(3, 5);
+
192 d.UnionSet(5, 6);
+
193 d.UnionSet(5, 7);
+
194 vector<uint64_t> ans = {3, 7, 4};
+
195 for (uint64_t i = 0; i < ans.size(); i++) {
+
196 assert(d.get(3).at(i) == ans[i]); // makes sure algorithm works fine
+
197 }
+
198 cout << "2nd test passed!" << endl;
+
199}
+
+Here is the call graph for this function:
+
+
+
+
+ +
+
+
+
+ + + + diff --git a/d3/dae/dsu__path__compression_8cpp.js b/d3/dae/dsu__path__compression_8cpp.js new file mode 100644 index 000000000..9e8f7c73c --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp.js @@ -0,0 +1,7 @@ +var dsu__path__compression_8cpp = +[ + [ "dsu", "dd/d1f/classdsu.html", "dd/d1f/classdsu" ], + [ "main", "d3/dae/dsu__path__compression_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "test1", "d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243", null ], + [ "test2", "d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae", null ] +]; \ No newline at end of file diff --git a/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map b/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map new file mode 100644 index 000000000..e03dbd622 --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 b/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 new file mode 100644 index 000000000..7434347a4 --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 @@ -0,0 +1 @@ +3d43b694568d4acc9db14b0c16a23771 \ No newline at end of file diff --git a/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg b/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg new file mode 100644 index 000000000..6cda787bf --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg @@ -0,0 +1,223 @@ + + + + + + +test2 + + + +Node1 + + +test2 + + + + + +Node2 + + +ans + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::get + + + + + +Node1->Node3 + + + + + +Node8 + + +dsu::UnionSet + + + + + +Node1->Node8 + + + + + +Node3->Node2 + + + + + +Node4 + + +dsu::get_max + + + + + +Node3->Node4 + + + + + +Node6 + + +dsu::get_min + + + + + +Node3->Node6 + + + + + +Node7 + + +dsu::size + + + + + +Node3->Node7 + + + + + +Node5 + + +dsu::findSet + + + + + +Node4->Node5 + + + + + +Node5->Node5 + + + + + +Node6->Node5 + + + + + +Node7->Node5 + + + + + +Node8->Node5 + + + + + +Node9 + + +dsu::isSame + + + + + +Node8->Node9 + + + + + +Node10 + + +std::max + + + + + +Node8->Node10 + + + + + +Node11 + + +std::min + + + + + +Node8->Node11 + + + + + +Node12 + + +std::swap + + + + + +Node8->Node12 + + + + + +Node9->Node5 + + + + + diff --git a/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..43cb2e419 --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..228596e2c --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +4fb177677523c9cec4ff5d035a533845 \ No newline at end of file diff --git a/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..56a0f88a0 --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,271 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test1 + + + + + +Node1->Node2 + + + + + +Node14 + + +test2 + + + + + +Node1->Node14 + + + + + +Node3 + + +ans + + + + + +Node2->Node3 + + + + + +Node4 + + +dsu::get + + + + + +Node2->Node4 + + + + + +Node9 + + +dsu::UnionSet + + + + + +Node2->Node9 + + + + + +Node4->Node3 + + + + + +Node5 + + +dsu::get_max + + + + + +Node4->Node5 + + + + + +Node7 + + +dsu::get_min + + + + + +Node4->Node7 + + + + + +Node8 + + +dsu::size + + + + + +Node4->Node8 + + + + + +Node6 + + +dsu::findSet + + + + + +Node5->Node6 + + + + + +Node6->Node6 + + + + + +Node7->Node6 + + + + + +Node8->Node6 + + + + + +Node9->Node6 + + + + + +Node10 + + +dsu::isSame + + + + + +Node9->Node10 + + + + + +Node11 + + +std::max + + + + + +Node9->Node11 + + + + + +Node12 + + +std::min + + + + + +Node9->Node12 + + + + + +Node13 + + +std::swap + + + + + +Node9->Node13 + + + + + +Node10->Node6 + + + + + +Node14->Node3 + + + + + +Node14->Node4 + + + + + +Node14->Node9 + + + + + diff --git a/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map b/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map new file mode 100644 index 000000000..006069275 --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 b/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 new file mode 100644 index 000000000..6012093ef --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 @@ -0,0 +1 @@ +3bec5290d87010e3e3fc47c4fae30552 \ No newline at end of file diff --git a/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg b/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg new file mode 100644 index 000000000..957b5dc3b --- /dev/null +++ b/d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg @@ -0,0 +1,223 @@ + + + + + + +test1 + + + +Node1 + + +test1 + + + + + +Node2 + + +ans + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::get + + + + + +Node1->Node3 + + + + + +Node8 + + +dsu::UnionSet + + + + + +Node1->Node8 + + + + + +Node3->Node2 + + + + + +Node4 + + +dsu::get_max + + + + + +Node3->Node4 + + + + + +Node6 + + +dsu::get_min + + + + + +Node3->Node6 + + + + + +Node7 + + +dsu::size + + + + + +Node3->Node7 + + + + + +Node5 + + +dsu::findSet + + + + + +Node4->Node5 + + + + + +Node5->Node5 + + + + + +Node6->Node5 + + + + + +Node7->Node5 + + + + + +Node8->Node5 + + + + + +Node9 + + +dsu::isSame + + + + + +Node8->Node9 + + + + + +Node10 + + +std::max + + + + + +Node8->Node10 + + + + + +Node11 + + +std::min + + + + + +Node8->Node11 + + + + + +Node12 + + +std::swap + + + + + +Node8->Node12 + + + + + +Node9->Node5 + + + + + diff --git a/d5/d88/md__d_i_r_e_c_t_o_r_y.html b/d5/d88/md__d_i_r_e_c_t_o_r_y.html index e09efd001..8c45ece0d 100644 --- a/d5/d88/md__d_i_r_e_c_t_o_r_y.html +++ b/d5/d88/md__d_i_r_e_c_t_o_r_y.html @@ -150,6 +150,8 @@ Data Structures
  • Disjoint Set
  • Doubly Linked List
  • +
  • Dsu Path Compression
  • +
  • Dsu Union Rank
  • Linked List
  • Linkedlist Implentation Usingarray
  • List Array
  • diff --git a/d7/dda/dsu__union__rank_8cpp__incl.map b/d7/dda/dsu__union__rank_8cpp__incl.map new file mode 100644 index 000000000..208c0e872 --- /dev/null +++ b/d7/dda/dsu__union__rank_8cpp__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/d7/dda/dsu__union__rank_8cpp__incl.md5 b/d7/dda/dsu__union__rank_8cpp__incl.md5 new file mode 100644 index 000000000..aac8bed95 --- /dev/null +++ b/d7/dda/dsu__union__rank_8cpp__incl.md5 @@ -0,0 +1 @@ +2bea4e84d633d060d571c12ebb17f64a \ No newline at end of file diff --git a/d7/dda/dsu__union__rank_8cpp__incl.svg b/d7/dda/dsu__union__rank_8cpp__incl.svg new file mode 100644 index 000000000..cdca7c766 --- /dev/null +++ b/d7/dda/dsu__union__rank_8cpp__incl.svg @@ -0,0 +1,68 @@ + + + + + + +data_structures/dsu_union_rank.cpp + + + +Node1 + + +data_structures/dsu +_union_rank.cpp + + + + + +Node2 + + +cassert + + + + + +Node1->Node2 + + + + + +Node3 + + +iostream + + + + + +Node1->Node3 + + + + + +Node4 + + +vector + + + + + +Node1->Node4 + + + + + diff --git a/d8/d99/connected__components__with__dsu_8cpp.html b/d8/d99/connected__components__with__dsu_8cpp.html index e2b16ebd2..832d10ae4 100644 --- a/d8/d99/connected__components__with__dsu_8cpp.html +++ b/d8/d99/connected__components__with__dsu_8cpp.html @@ -330,7 +330,7 @@ Here is the call graph for this function:

    Test Implementations.

    Returns
    void
    92 {
    -
    93 namespace dsu = graph::disjoint_union;
    +
    93 namespace dsu = graph::disjoint_union;
    94 std::cin >> dsu::number_of_nodes;
    95 dsu::parent.resize(dsu::number_of_nodes + 1);
    96 dsu::connected_set_size.resize(dsu::number_of_nodes + 1);
    @@ -346,6 +346,7 @@ Here is the call graph for this function:
    106}
    std::cin
    std::cout
    +
    dsu
    Disjoint sets union data structure, class based representation.
    Definition: dsu_path_compression.cpp:33
    std::endl
    T endl(T... args)
    diff --git a/db/de3/dsu__path__compression_8cpp__incl.map b/db/de3/dsu__path__compression_8cpp__incl.map new file mode 100644 index 000000000..5f1e7bc3f --- /dev/null +++ b/db/de3/dsu__path__compression_8cpp__incl.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/db/de3/dsu__path__compression_8cpp__incl.md5 b/db/de3/dsu__path__compression_8cpp__incl.md5 new file mode 100644 index 000000000..2b79ec4a4 --- /dev/null +++ b/db/de3/dsu__path__compression_8cpp__incl.md5 @@ -0,0 +1 @@ +ad4e904f4dbafcf8342876c023a9313d \ No newline at end of file diff --git a/db/de3/dsu__path__compression_8cpp__incl.svg b/db/de3/dsu__path__compression_8cpp__incl.svg new file mode 100644 index 000000000..d09b7dd2b --- /dev/null +++ b/db/de3/dsu__path__compression_8cpp__incl.svg @@ -0,0 +1,68 @@ + + + + + + +data_structures/dsu_path_compression.cpp + + + +Node1 + + +data_structures/dsu +_path_compression.cpp + + + + + +Node2 + + +cassert + + + + + +Node1->Node2 + + + + + +Node3 + + +iostream + + + + + +Node1->Node3 + + + + + +Node4 + + +vector + + + + + +Node1->Node4 + + + + + diff --git a/dd/d1f/classdsu.html b/dd/d1f/classdsu.html new file mode 100644 index 000000000..f496de46f --- /dev/null +++ b/dd/d1f/classdsu.html @@ -0,0 +1,916 @@ + + + + + + + +Algorithms_in_C++: dsu Class Reference + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Algorithms_in_C++ 1.0.0 +
    +
    Set of algorithms implemented in C++.
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    dsu Class Reference
    +
    +
    + +

    Disjoint sets union data structure, class based representation. + More...

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Member Functions

     dsu (uint64_t n)
     contructor for initialising all data members. More...
     
    uint64_t findSet (uint64_t i)
     Method to find the representative of the set to which i belongs to, T(n) = O(1) More...
     
    void UnionSet (uint64_t i, uint64_t j)
     Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative. More...
     
    bool isSame (uint64_t i, uint64_t j)
     A utility function which check whether i and j belongs to same set or not. More...
     
    vector< uint64_t > get (uint64_t i)
     prints the minimum, maximum and size of the set to which i belongs to More...
     
    uint64_t size (uint64_t i)
     A utility function that returns the size of the set to which i belongs to. More...
     
    uint64_t get_max (uint64_t i)
     A utility function that returns the max element of the set to which i belongs to. More...
     
    uint64_t get_min (uint64_t i)
     A utility function that returns the min element of the set to which i belongs to. More...
     
     dsu (uint64_t n)
     constructor for initialising all data members More...
     
    uint64_t findSet (uint64_t i)
     Method to find the representative of the set to which i belongs to, T(n) = O(logN) More...
     
    void unionSet (uint64_t i, uint64_t j)
     Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative. More...
     
    bool isSame (uint64_t i, uint64_t j)
     A utility function which check whether i and j belongs to same set or not. More...
     
    vector< uint64_t > getParents (uint64_t i)
     Method to print all the parents of i, or the path from i to representative. More...
     
    + + + + + + + + + + + + + + + + +

    +Private Attributes

    +vector< uint64_t > p
     keeps track of the parent of ith element
     
    +vector< uint64_t > depth
     tracks the depth(rank) of i in the tree
     
    +vector< uint64_t > setSize
     size of each chunk(set)
     
    +vector< uint64_t > maxElement
     maximum of each set to which i belongs to
     
    +vector< uint64_t > minElement
     minimum of each set to which i belongs to
     
    +

    Detailed Description

    +

    Disjoint sets union data structure, class based representation.

    +
    Parameters
    + + +
    nnumber of elements
    +
    +
    +

    Constructor & Destructor Documentation

    + +

    ◆ dsu() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dsu::dsu (uint64_t n)
    +
    +inlineexplicit
    +
    + +

    contructor for initialising all data members.

    +
    Parameters
    + + +
    nnumber of elements
    +
    +
    +

    initially, all of them are their own parents

    +

    initially all have depth are equals to zero

    +

    initially set size will be equals to one

    +
    45 {
    +
    46 p.assign(n, 0);
    +
    47 /// initially, all of them are their own parents
    +
    48 for (uint64_t i = 0; i < n; i++) {
    +
    49 p[i] = i;
    +
    50 }
    +
    51 /// initially all have depth are equals to zero
    +
    52 depth.assign(n, 0);
    +
    53 maxElement.assign(n, 0);
    +
    54 minElement.assign(n, 0);
    +
    55 for (uint64_t i = 0; i < n; i++) {
    +
    56 depth[i] = 0;
    +
    57 maxElement[i] = i;
    +
    58 minElement[i] = i;
    +
    59 }
    +
    60 setSize.assign(n, 0);
    +
    61 /// initially set size will be equals to one
    +
    62 for (uint64_t i = 0; i < n; i++) {
    +
    63 setSize[i] = 1;
    +
    64 }
    +
    65 }
    +
    vector< uint64_t > minElement
    minimum of each set to which i belongs to
    Definition: dsu_path_compression.cpp:39
    +
    vector< uint64_t > p
    keeps track of the parent of ith element
    Definition: dsu_path_compression.cpp:35
    +
    vector< uint64_t > maxElement
    maximum of each set to which i belongs to
    Definition: dsu_path_compression.cpp:38
    +
    vector< uint64_t > depth
    tracks the depth(rank) of i in the tree
    Definition: dsu_path_compression.cpp:36
    +
    vector< uint64_t > setSize
    size of each chunk(set)
    Definition: dsu_path_compression.cpp:37
    +
    +
    +
    + +

    ◆ dsu() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    dsu::dsu (uint64_t n)
    +
    +inlineexplicit
    +
    + +

    constructor for initialising all data members

    +
    Parameters
    + + +
    nnumber of elements
    +
    +
    +

    initially all of them are their own parents

    +
    44 {
    +
    45 p.assign(n, 0);
    +
    46 /// initially all of them are their own parents
    +
    47 depth.assign(n, 0);
    +
    48 setSize.assign(n, 0);
    +
    49 for (uint64_t i = 0; i < n; i++) {
    +
    50 p[i] = i;
    +
    51 depth[i] = 0;
    +
    52 setSize[i] = 1;
    +
    53 }
    +
    54 }
    +
    +
    +
    +

    Member Function Documentation

    + +

    ◆ findSet() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    uint64_t dsu::findSet (uint64_t i)
    +
    +inline
    +
    + +

    Method to find the representative of the set to which i belongs to, T(n) = O(1)

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    representative of the set to which i belongs to.
    +

    using path compression

    +
    73 {
    +
    74 /// using path compression
    +
    75 if (p[i] == i) {
    +
    76 return i;
    +
    77 }
    +
    78 return (p[i] = findSet(p[i]));
    +
    79 }
    +
    uint64_t findSet(uint64_t i)
    Method to find the representative of the set to which i belongs to, T(n) = O(1)
    Definition: dsu_path_compression.cpp:73
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ findSet() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    uint64_t dsu::findSet (uint64_t i)
    +
    +inline
    +
    + +

    Method to find the representative of the set to which i belongs to, T(n) = O(logN)

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    representative of the set to which i belongs to
    +

    using union-rank

    +
    61 {
    +
    62 /// using union-rank
    +
    63 while (i != p[i]) {
    +
    64 i = p[i];
    +
    65 }
    +
    66 return i;
    +
    67 }
    +
    +
    +
    + +

    ◆ get()

    + +
    +
    + + + + + +
    + + + + + + + + +
    vector< uint64_t > dsu::get (uint64_t i)
    +
    +inline
    +
    + +

    prints the minimum, maximum and size of the set to which i belongs to

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    void
    +
    135 {
    + +
    137 ans.push_back(get_min(i));
    +
    138 ans.push_back(get_max(i));
    +
    139 ans.push_back(size(i));
    +
    140 return ans;
    +
    141 }
    +
    uint64_t size(uint64_t i)
    A utility function that returns the size of the set to which i belongs to.
    Definition: dsu_path_compression.cpp:148
    +
    uint64_t get_max(uint64_t i)
    A utility function that returns the max element of the set to which i belongs to.
    Definition: dsu_path_compression.cpp:155
    +
    uint64_t get_min(uint64_t i)
    A utility function that returns the min element of the set to which i belongs to.
    Definition: dsu_path_compression.cpp:162
    +
    ll ans(ll n)
    Definition: matrix_exponentiation.cpp:91
    + +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ get_max()

    + +
    +
    + + + + + +
    + + + + + + + + +
    uint64_t dsu::get_max (uint64_t i)
    +
    +inline
    +
    + +

    A utility function that returns the max element of the set to which i belongs to.

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    maximum of the set to which i belongs to
    +
    155{ return maxElement[findSet(i)]; }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ get_min()

    + +
    +
    + + + + + +
    + + + + + + + + +
    uint64_t dsu::get_min (uint64_t i)
    +
    +inline
    +
    + +

    A utility function that returns the min element of the set to which i belongs to.

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    minimum of the set to which i belongs to
    +
    162{ return minElement[findSet(i)]; }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ getParents()

    + +
    +
    + + + + + +
    + + + + + + + + +
    vector< uint64_t > dsu::getParents (uint64_t i)
    +
    +inline
    +
    + +

    Method to print all the parents of i, or the path from i to representative.

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    void
    +
    119 {
    + +
    121 while (p[i] != i) {
    +
    122 ans.push_back(i);
    +
    123 i = p[i];
    +
    124 }
    +
    125 ans.push_back(i);
    +
    126 return ans;
    +
    127 }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ isSame() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    bool dsu::isSame (uint64_t i,
    uint64_t j 
    )
    +
    +inline
    +
    + +

    A utility function which check whether i and j belongs to same set or not.

    +
    Parameters
    + + + +
    ielement of some set
    jelement of some set
    +
    +
    +
    Returns
    true if element i and j ARE in the same set
    +
    +false if element i and j are NOT in same set
    +
    123 {
    +
    124 if (findSet(i) == findSet(j)) {
    +
    125 return true;
    +
    126 }
    +
    127 return false;
    +
    128 }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ isSame() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    bool dsu::isSame (uint64_t i,
    uint64_t j 
    )
    +
    +inline
    +
    + +

    A utility function which check whether i and j belongs to same set or not.

    +
    Parameters
    + + + +
    ielement of some set
    jelement of some set
    +
    +
    +
    Returns
    true if element i and j are in same set
    +
    +false if element i and j are not in same set
    +
    107 {
    +
    108 if (findSet(i) == findSet(j)) {
    +
    109 return true;
    +
    110 }
    +
    111 return false;
    +
    112 }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ size()

    + +
    +
    + + + + + +
    + + + + + + + + +
    uint64_t dsu::size (uint64_t i)
    +
    +inline
    +
    + +

    A utility function that returns the size of the set to which i belongs to.

    +
    Parameters
    + + +
    ielement of some set
    +
    +
    +
    Returns
    size of the set to which i belongs to
    +
    148{ return setSize[findSet(i)]; }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ UnionSet()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    void dsu::UnionSet (uint64_t i,
    uint64_t j 
    )
    +
    +inline
    +
    + +

    Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative.

    +
    Parameters
    + + + +
    ielement of some set
    jelement of some set
    +
    +
    +
    Returns
    void
    +

    check if both belongs to the same set or not

    +

    always keeping the min as x shallow tree

    +

    making the shallower root's parent the deeper root

    +

    if same depth, then increase one's depth

    +

    total size of the resultant set

    +

    changing the maximum elements

    +
    87 {
    +
    88 /// check if both belongs to the same set or not
    +
    89 if (isSame(i, j)) {
    +
    90 return;
    +
    91 }
    +
    92
    +
    93 // we find the representative of the i and j
    +
    94 uint64_t x = findSet(i);
    +
    95 uint64_t y = findSet(j);
    +
    96
    +
    97 /// always keeping the min as x
    +
    98 /// shallow tree
    +
    99 if (depth[x] > depth[y]) {
    +
    100 std::swap(x, y);
    +
    101 }
    +
    102 /// making the shallower root's parent the deeper root
    +
    103 p[x] = y;
    +
    104
    +
    105 /// if same depth, then increase one's depth
    +
    106 if (depth[x] == depth[y]) {
    +
    107 depth[y]++;
    +
    108 }
    +
    109 /// total size of the resultant set
    +
    110 setSize[y] += setSize[x];
    +
    111 /// changing the maximum elements
    + + +
    114 }
    +
    bool isSame(uint64_t i, uint64_t j)
    A utility function which check whether i and j belongs to same set or not.
    Definition: dsu_path_compression.cpp:123
    +
    T max(T... args)
    +
    T min(T... args)
    +
    T swap(T... args)
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ unionSet()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + +
    void dsu::unionSet (uint64_t i,
    uint64_t j 
    )
    +
    +inline
    +
    + +

    Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative.

    +
    Parameters
    + + + +
    ielement of some set
    jelement of some set
    +
    +
    +
    Returns
    void
    +

    checks if both belongs to same set or not

    +

    we find representative of the i and j

    +

    always keeping the min as x in order to create a shallow tree

    +

    making the shallower tree, root parent of the deeper root

    +

    if same depth, then increase one's depth

    +

    total size of the resultant set

    +
    75 {
    +
    76 /// checks if both belongs to same set or not
    +
    77 if (isSame(i, j)) {
    +
    78 return;
    +
    79 }
    +
    80 /// we find representative of the i and j
    +
    81 uint64_t x = findSet(i);
    +
    82 uint64_t y = findSet(j);
    +
    83
    +
    84 /// always keeping the min as x
    +
    85 /// in order to create a shallow tree
    +
    86 if (depth[x] > depth[y]) {
    +
    87 std::swap(x, y);
    +
    88 }
    +
    89 /// making the shallower tree, root parent of the deeper root
    +
    90 p[x] = y;
    +
    91
    +
    92 /// if same depth, then increase one's depth
    +
    93 if (depth[x] == depth[y]) {
    +
    94 depth[y]++;
    +
    95 }
    +
    96 /// total size of the resultant set
    +
    97 setSize[y] += setSize[x];
    +
    98 }
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    +
    The documentation for this class was generated from the following files: +
    +
    + + + + diff --git a/dd/d1f/classdsu.js b/dd/d1f/classdsu.js new file mode 100644 index 000000000..95fc23687 --- /dev/null +++ b/dd/d1f/classdsu.js @@ -0,0 +1,21 @@ +var classdsu = +[ + [ "dsu", "dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72", null ], + [ "dsu", "dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72", null ], + [ "findSet", "dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c", null ], + [ "findSet", "dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c", null ], + [ "get", "dd/d1f/classdsu.html#a0ce2672c570f4235eafddb0c9a58115a", null ], + [ "get_max", "dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde", null ], + [ "get_min", "dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415", null ], + [ "getParents", "dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280", null ], + [ "isSame", "dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303", null ], + [ "isSame", "dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303", null ], + [ "size", "dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c", null ], + [ "UnionSet", "dd/d1f/classdsu.html#a6ac30c07abca2aaa3b291504c25c3559", null ], + [ "unionSet", "dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f", null ], + [ "depth", "dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429", null ], + [ "maxElement", "dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53", null ], + [ "minElement", "dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63", null ], + [ "p", "dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb", null ], + [ "setSize", "dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55", null ] +]; \ No newline at end of file diff --git a/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.map b/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.map new file mode 100644 index 000000000..1d3c53258 --- /dev/null +++ b/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.md5 b/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.md5 new file mode 100644 index 000000000..93620c711 --- /dev/null +++ b/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.md5 @@ -0,0 +1 @@ +490a8d37b5f0cb86c4f3a58c56b5ea6d \ No newline at end of file diff --git a/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.svg b/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.svg new file mode 100644 index 000000000..f5737d5ed --- /dev/null +++ b/dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.svg @@ -0,0 +1,115 @@ + + + + + + +dsu::get + + + +Node1 + + +dsu::get + + + + + +Node2 + + +ans + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::get_max + + + + + +Node1->Node3 + + + + + +Node5 + + +dsu::get_min + + + + + +Node1->Node5 + + + + + +Node6 + + +dsu::size + + + + + +Node1->Node6 + + + + + +Node4 + + +dsu::findSet + + + + + +Node3->Node4 + + + + + +Node4->Node4 + + + + + +Node5->Node4 + + + + + +Node6->Node4 + + + + + diff --git a/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.map b/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.map new file mode 100644 index 000000000..4e5ff80a6 --- /dev/null +++ b/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.map @@ -0,0 +1,3 @@ + + + diff --git a/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.md5 b/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.md5 new file mode 100644 index 000000000..450d18ebc --- /dev/null +++ b/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.md5 @@ -0,0 +1 @@ +68901429c8095fec6a63c6963f3a6644 \ No newline at end of file diff --git a/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.svg b/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.svg new file mode 100644 index 000000000..0a726307d --- /dev/null +++ b/dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.svg @@ -0,0 +1,28 @@ + + + + + + +dsu::findSet + + + +Node1 + + +dsu::findSet + + + + + +Node1->Node1 + + + + + diff --git a/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.map b/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.map new file mode 100644 index 000000000..95ea6dbac --- /dev/null +++ b/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.md5 b/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.md5 new file mode 100644 index 000000000..2918a9912 --- /dev/null +++ b/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.md5 @@ -0,0 +1 @@ +623f7b626b35cfcf465d13ea8247d333 \ No newline at end of file diff --git a/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.svg b/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.svg new file mode 100644 index 000000000..c0df57840 --- /dev/null +++ b/dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +dsu::size + + + +Node1 + + +dsu::size + + + + + +Node2 + + +dsu::findSet + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.map b/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.map new file mode 100644 index 000000000..e04793c54 --- /dev/null +++ b/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.md5 b/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.md5 new file mode 100644 index 000000000..5e4ff1375 --- /dev/null +++ b/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.md5 @@ -0,0 +1 @@ +96cd263a1b02117642467e38dc9d3ca0 \ No newline at end of file diff --git a/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.svg b/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.svg new file mode 100644 index 000000000..c97c43124 --- /dev/null +++ b/dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +dsu::isSame + + + +Node1 + + +dsu::isSame + + + + + +Node2 + + +dsu::findSet + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.map b/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.map new file mode 100644 index 000000000..84c2d8eae --- /dev/null +++ b/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.md5 b/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.md5 new file mode 100644 index 000000000..cdc664f7e --- /dev/null +++ b/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.md5 @@ -0,0 +1 @@ +831d13dfb388de7742825db431cdc93a \ No newline at end of file diff --git a/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.svg b/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.svg new file mode 100644 index 000000000..87bfdbfe9 --- /dev/null +++ b/dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +dsu::get_max + + + +Node1 + + +dsu::get_max + + + + + +Node2 + + +dsu::findSet + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.map b/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.map new file mode 100644 index 000000000..3c63a9041 --- /dev/null +++ b/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.md5 b/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.md5 new file mode 100644 index 000000000..895841780 --- /dev/null +++ b/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.md5 @@ -0,0 +1 @@ +6e96a1598377c2c50062e9990a4335f6 \ No newline at end of file diff --git a/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.svg b/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.svg new file mode 100644 index 000000000..d9a5828aa --- /dev/null +++ b/dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.svg @@ -0,0 +1,109 @@ + + + + + + +dsu::UnionSet + + + +Node1 + + +dsu::UnionSet + + + + + +Node2 + + +dsu::findSet + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::isSame + + + + + +Node1->Node3 + + + + + +Node4 + + +std::max + + + + + +Node1->Node4 + + + + + +Node5 + + +std::min + + + + + +Node1->Node5 + + + + + +Node6 + + +std::swap + + + + + +Node1->Node6 + + + + + +Node2->Node2 + + + + + +Node3->Node2 + + + + + diff --git a/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.map b/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.map new file mode 100644 index 000000000..c12502221 --- /dev/null +++ b/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.md5 b/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.md5 new file mode 100644 index 000000000..a7d0d7c2d --- /dev/null +++ b/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.md5 @@ -0,0 +1 @@ +1b0376de3bec490e5775b64645a04801 \ No newline at end of file diff --git a/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.svg b/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.svg new file mode 100644 index 000000000..9ebf3d779 --- /dev/null +++ b/dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.svg @@ -0,0 +1,79 @@ + + + + + + +dsu::unionSet + + + +Node1 + + +dsu::unionSet + + + + + +Node2 + + +dsu::findSet + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::isSame + + + + + +Node1->Node3 + + + + + +Node4 + + +std::swap + + + + + +Node1->Node4 + + + + + +Node2->Node2 + + + + + +Node3->Node2 + + + + + diff --git a/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.map b/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.map new file mode 100644 index 000000000..9ff74d244 --- /dev/null +++ b/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.md5 b/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.md5 new file mode 100644 index 000000000..0ab0a920d --- /dev/null +++ b/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.md5 @@ -0,0 +1 @@ +63bfa50bd8a4707f867af6c434c208b1 \ No newline at end of file diff --git a/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.svg b/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.svg new file mode 100644 index 000000000..5941fcc25 --- /dev/null +++ b/dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.svg @@ -0,0 +1,37 @@ + + + + + + +dsu::getParents + + + +Node1 + + +dsu::getParents + + + + + +Node2 + + +ans + + + + + +Node1->Node2 + + + + + diff --git a/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.map b/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.map new file mode 100644 index 000000000..bb4a6ccb4 --- /dev/null +++ b/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.map @@ -0,0 +1,4 @@ + + + + diff --git a/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.md5 b/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.md5 new file mode 100644 index 000000000..fb4f5055c --- /dev/null +++ b/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.md5 @@ -0,0 +1 @@ +47fee60ab5e8f8593f22e6db15fae70d \ No newline at end of file diff --git a/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.svg b/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.svg new file mode 100644 index 000000000..8aae685a3 --- /dev/null +++ b/dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.svg @@ -0,0 +1,43 @@ + + + + + + +dsu::get_min + + + +Node1 + + +dsu::get_min + + + + + +Node2 + + +dsu::findSet + + + + + +Node1->Node2 + + + + + +Node2->Node2 + + + + + diff --git a/df/d28/dsu__union__rank_8cpp.html b/df/d28/dsu__union__rank_8cpp.html new file mode 100644 index 000000000..0066cd3bf --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp.html @@ -0,0 +1,302 @@ + + + + + + + +Algorithms_in_C++: data_structures/dsu_union_rank.cpp File Reference + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Algorithms_in_C++ 1.0.0 +
    +
    Set of algorithms implemented in C++.
    +
    +
    + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    + +
    + +
    + +
    dsu_union_rank.cpp File Reference
    +
    +
    + +

    DSU (Disjoint sets) +More...

    +
    #include <cassert>
    +#include <iostream>
    +#include <vector>
    +
    +Include dependency graph for dsu_union_rank.cpp:
    +
    +
    +
    +
    +
    + + + + +

    +Classes

    class  dsu
     Disjoint sets union data structure, class based representation. More...
     
    + + + + + + + + + + +

    +Functions

    static void test1 ()
     Self-implementations, 1st test. More...
     
    static void test2 ()
     Self-implementations, 2nd test. More...
     
    int main ()
     Main function. More...
     
    +

    Detailed Description

    +

    DSU (Disjoint sets)

    +

    dsu : It is a very powerful data structure which keeps track of different clusters(sets) of elements, these sets are disjoint(doesnot have a common element). Disjoint sets uses cases : for finding connected components in a graph, used in Kruskal's algorithm for finding Minimum Spanning tree. Operations that can be performed: 1) UnionSet(i,j): add(element i and j to the set) 2) findSet(i): returns the representative of the set to which i belogngs to. 3) getParents(i): prints the parent of i and so on and so forth. Below is the class-based approach which uses the heuristic of union-ranks. Using union-rank in findSet(i),we are able to get to the representative of i in slightly delayed O(logN) time but it allows us to keep tracks of the parent of i.

    Author
    AayushVyasKIIT
    +
    See also
    dsu_path_compression.cpp
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + + +
    int main (void )
    +
    + +

    Main function.

    +
    Returns
    0 on exit
    +
    182 {
    +
    183 test1(); // run 1st test case
    +
    184 test2(); // run 2nd test case
    +
    185
    +
    186 return 0;
    +
    187}
    +
    static void test2()
    Self-implementations, 2nd test.
    Definition: dsu_union_rank.cpp:157
    +
    static void test1()
    Self-implementations, 1st test.
    Definition: dsu_union_rank.cpp:133
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ test1()

    + +
    +
    + + + + + +
    + + + + + + + +
    static void test1 ()
    +
    +static
    +
    + +

    Self-implementations, 1st test.

    +
    Returns
    void
    +

    < number of elements

    +

    < object of class disjoint sets

    +

    < performs union operation on 1 and 2

    +
    133 {
    +
    134 /* checks the parents in the resultant structures */
    +
    135 uint64_t n = 10; ///< number of elements
    +
    136 dsu d(n + 1); ///< object of class disjoint sets
    +
    137 d.unionSet(2, 1); ///< performs union operation on 1 and 2
    +
    138 d.unionSet(1, 4);
    +
    139 d.unionSet(8, 1);
    +
    140 d.unionSet(3, 5);
    +
    141 d.unionSet(5, 6);
    +
    142 d.unionSet(5, 7);
    +
    143 d.unionSet(9, 10);
    +
    144 d.unionSet(2, 10);
    +
    145 // keeping track of the changes using parent pointers
    +
    146 vector<uint64_t> ans = {7, 5};
    +
    147 for (uint64_t i = 0; i < ans.size(); i++) {
    +
    148 assert(d.getParents(7).at(i) ==
    +
    149 ans[i]); // makes sure algorithm works fine
    +
    150 }
    +
    151 cout << "1st test passed!" << endl;
    +
    152}
    + +
    Disjoint sets union data structure, class based representation.
    Definition: dsu_path_compression.cpp:33
    +
    #define endl
    Definition: matrix_exponentiation.cpp:36
    +
    ll ans(ll n)
    Definition: matrix_exponentiation.cpp:91
    + +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    + +

    ◆ test2()

    + +
    +
    + + + + + +
    + + + + + + + +
    static void test2 ()
    +
    +static
    +
    + +

    Self-implementations, 2nd test.

    +
    Returns
    void
    +

    < number of elements

    +

    < object of class disjoint sets

    +

    performs union operation on 1 and 2

    +

    keeping track of the changes using parent pointers

    +

    makes sure algorithm works fine

    +
    157 {
    +
    158 // checks the parents in the resultant structures
    +
    159 uint64_t n = 10; ///< number of elements
    +
    160 dsu d(n + 1); ///< object of class disjoint sets
    +
    161 d.unionSet(2, 1); /// performs union operation on 1 and 2
    +
    162 d.unionSet(1, 4);
    +
    163 d.unionSet(8, 1);
    +
    164 d.unionSet(3, 5);
    +
    165 d.unionSet(5, 6);
    +
    166 d.unionSet(5, 7);
    +
    167 d.unionSet(9, 10);
    +
    168 d.unionSet(2, 10);
    +
    169
    +
    170 /// keeping track of the changes using parent pointers
    +
    171 vector<uint64_t> ans = {2, 1, 10};
    +
    172 for (uint64_t i = 0; i < ans.size(); i++) {
    +
    173 assert(d.getParents(2).at(i) ==
    +
    174 ans[i]); /// makes sure algorithm works fine
    +
    175 }
    +
    176 cout << "2nd test passed!" << endl;
    +
    177}
    +
    +Here is the call graph for this function:
    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + diff --git a/df/d28/dsu__union__rank_8cpp.js b/df/d28/dsu__union__rank_8cpp.js new file mode 100644 index 000000000..46b7779fa --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp.js @@ -0,0 +1,7 @@ +var dsu__union__rank_8cpp = +[ + [ "dsu", "dd/d1f/classdsu.html", "dd/d1f/classdsu" ], + [ "main", "df/d28/dsu__union__rank_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], + [ "test1", "df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243", null ], + [ "test2", "df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae", null ] +]; \ No newline at end of file diff --git a/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map b/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map new file mode 100644 index 000000000..a1567a006 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 b/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 new file mode 100644 index 000000000..cf5adcc16 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.md5 @@ -0,0 +1 @@ +413d5a9409029480fc4dd4ab917bdc62 \ No newline at end of file diff --git a/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg b/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg new file mode 100644 index 000000000..6053935e6 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg @@ -0,0 +1,130 @@ + + + + + + +test2 + + + +Node1 + + +test2 + + + + + +Node2 + + +ans + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::getParents + + + + + +Node1->Node3 + + + + + +Node4 + + +dsu::unionSet + + + + + +Node1->Node4 + + + + + +Node3->Node2 + + + + + +Node5 + + +dsu::findSet + + + + + +Node4->Node5 + + + + + +Node6 + + +dsu::isSame + + + + + +Node4->Node6 + + + + + +Node7 + + +std::swap + + + + + +Node4->Node7 + + + + + +Node5->Node5 + + + + + +Node6->Node5 + + + + + diff --git a/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map new file mode 100644 index 000000000..a3d53b017 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 new file mode 100644 index 000000000..c0f776935 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -0,0 +1 @@ +0a7e08d906379ef71155e6daf0c91734 \ No newline at end of file diff --git a/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg new file mode 100644 index 000000000..90710a129 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -0,0 +1,178 @@ + + + + + + +main + + + +Node1 + + +main + + + + + +Node2 + + +test1 + + + + + +Node1->Node2 + + + + + +Node9 + + +test2 + + + + + +Node1->Node9 + + + + + +Node3 + + +ans + + + + + +Node2->Node3 + + + + + +Node4 + + +dsu::getParents + + + + + +Node2->Node4 + + + + + +Node5 + + +dsu::unionSet + + + + + +Node2->Node5 + + + + + +Node4->Node3 + + + + + +Node6 + + +dsu::findSet + + + + + +Node5->Node6 + + + + + +Node7 + + +dsu::isSame + + + + + +Node5->Node7 + + + + + +Node8 + + +std::swap + + + + + +Node5->Node8 + + + + + +Node6->Node6 + + + + + +Node7->Node6 + + + + + +Node9->Node3 + + + + + +Node9->Node4 + + + + + +Node9->Node5 + + + + + diff --git a/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map b/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map new file mode 100644 index 000000000..8aa75103f --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 b/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 new file mode 100644 index 000000000..91752be8a --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.md5 @@ -0,0 +1 @@ +05fd810df88836bd72af8e5abb419c5c \ No newline at end of file diff --git a/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg b/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg new file mode 100644 index 000000000..e986182a1 --- /dev/null +++ b/df/d28/dsu__union__rank_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg @@ -0,0 +1,130 @@ + + + + + + +test1 + + + +Node1 + + +test1 + + + + + +Node2 + + +ans + + + + + +Node1->Node2 + + + + + +Node3 + + +dsu::getParents + + + + + +Node1->Node3 + + + + + +Node4 + + +dsu::unionSet + + + + + +Node1->Node4 + + + + + +Node3->Node2 + + + + + +Node5 + + +dsu::findSet + + + + + +Node4->Node5 + + + + + +Node6 + + +dsu::isSame + + + + + +Node4->Node6 + + + + + +Node7 + + +std::swap + + + + + +Node4->Node7 + + + + + +Node5->Node5 + + + + + +Node6->Node5 + + + + + diff --git a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html index 3819be2b0..e7a415644 100644 --- a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html +++ b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html @@ -114,6 +114,12 @@ Files file  disjoint_set.cpp  Disjoint Sets Data Structure (Disjoint Sets)
      +file  dsu_path_compression.cppDSU (Disjoint sets)
    +  +file  dsu_union_rank.cppDSU (Disjoint sets)
    +  file  linked_list.cpp  Implementation of singly linked list algorithm.
      diff --git a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js index b5eb2256f..5d00b37a2 100644 --- a/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js +++ b/dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js @@ -6,6 +6,8 @@ var dir_2e746e9d06bf2d8ff842208bcc6ebcfc = [ "binary_search_tree2.cpp", "df/d42/binary__search__tree2_8cpp.html", "df/d42/binary__search__tree2_8cpp" ], [ "binaryheap.cpp", "de/dc3/binaryheap_8cpp.html", "de/dc3/binaryheap_8cpp" ], [ "disjoint_set.cpp", "de/d23/disjoint__set_8cpp.html", "de/d23/disjoint__set_8cpp" ], + [ "dsu_path_compression.cpp", "d3/dae/dsu__path__compression_8cpp.html", "d3/dae/dsu__path__compression_8cpp" ], + [ "dsu_union_rank.cpp", "df/d28/dsu__union__rank_8cpp.html", "df/d28/dsu__union__rank_8cpp" ], [ "linked_list.cpp", "da/dc3/linked__list_8cpp.html", "da/dc3/linked__list_8cpp" ], [ "linkedlist_implentation_usingarray.cpp", "d3/dce/linkedlist__implentation__usingarray_8cpp.html", "d3/dce/linkedlist__implentation__usingarray_8cpp" ], [ "list_array.cpp", "d7/d00/list__array_8cpp.html", "d7/d00/list__array_8cpp" ], diff --git a/files.html b/files.html index 10aea84c3..7fe1b6d41 100644 --- a/files.html +++ b/files.html @@ -133,20 +133,22 @@ solve-a-rat-in-a-maze-c-java-pytho/"  binary_search_tree2.cppA generic binary search tree implementation  binaryheap.cppA C++ program to demonstrate common Binary Heap Operations  disjoint_set.cppDisjoint Sets Data Structure (Disjoint Sets) - linked_list.cppImplementation of singly linked list algorithm - linkedlist_implentation_usingarray.cppLinked list implementation using Arrays - list_array.cppDynamic Array - queue.h - queue_using_array.cppImplementation of Linear Queue using array - queue_using_two_stacks.cpp - reverse_a_linked_list.cppImplementation of Reversing a single linked list - skip_list.cppData structure for fast searching and insertion in \(O(\log n)\) time - sparse_table.cppImplementation of Sparse Table for min() function - stack.hThis class specifies the basic operation on a stack as a linked list - tree_234.cppA demo 2-3-4 tree implementation - trie_modern.cppA basic implementation of trie class to store only lower-case strings - trie_tree.cppImplementation of Trie data structure for English alphabets in small characters - trie_using_hashmap.cppImplementation of Trie data structure using HashMap for different characters and method for predicting words based on prefix + dsu_path_compression.cppDSU (Disjoint sets) + dsu_union_rank.cppDSU (Disjoint sets) + linked_list.cppImplementation of singly linked list algorithm + linkedlist_implentation_usingarray.cppLinked list implementation using Arrays + list_array.cppDynamic Array + queue.h + queue_using_array.cppImplementation of Linear Queue using array + queue_using_two_stacks.cpp + reverse_a_linked_list.cppImplementation of Reversing a single linked list + skip_list.cppData structure for fast searching and insertion in \(O(\log n)\) time + sparse_table.cppImplementation of Sparse Table for min() function + stack.hThis class specifies the basic operation on a stack as a linked list + tree_234.cppA demo 2-3-4 tree implementation + trie_modern.cppA basic implementation of trie class to store only lower-case strings + trie_tree.cppImplementation of Trie data structure for English alphabets in small characters + trie_using_hashmap.cppImplementation of Trie data structure using HashMap for different characters and method for predicting words based on prefix   divide_and_conquer  karatsuba_algorithm_for_fast_multiplication.cppImplementation of the Karatsuba algorithm for fast multiplication   dynamic_programming diff --git a/functions_d.html b/functions_d.html index c55af58d9..858f92433 100644 --- a/functions_d.html +++ b/functions_d.html @@ -105,7 +105,7 @@ $(document).ready(function(){initNavTree('functions_d.html',''); initResizable()
  • DeleteNode() : data_structures::tree_234::Tree234
  • deleteString() : data_structures::trie
  • DenseLayer() : machine_learning::neural_network::layers::DenseLayer
  • -
  • depth : machine_learning::aystar_search::AyStarSearch< Puzzle >::Info
  • +
  • depth : dsu, machine_learning::aystar_search::AyStarSearch< Puzzle >::Info
  • dequeue() : data_structures::queue_using_array::Queue_Array
  • deQueue() : queue< Kind >
  • dfs() : graph::HKGraph
  • @@ -121,6 +121,7 @@ $(document).ready(function(){initNavTree('functions_d.html',''); initResizable()
  • dist : graph::HKGraph
  • divide() : uint128_t, uint256_t
  • draw_sample() : probability::geometric_dist::geometric_distribution
  • +
  • dsu() : dsu
  • diff --git a/functions_f.html b/functions_f.html index 6d4f6dcf5..aff27223f 100644 --- a/functions_f.html +++ b/functions_f.html @@ -98,6 +98,7 @@ $(document).ready(function(){initNavTree('functions_f.html',''); initResizable()
  • find_max() : binary_search_tree< T >
  • find_min() : binary_search_tree< T >
  • find_zero() : machine_learning::aystar_search::EightPuzzle< N >
  • +
  • findSet() : dsu
  • first : data_structures::linked_list::list
  • fit() : machine_learning::adaline, machine_learning::neural_network::NeuralNetwork
  • fit_from_csv() : machine_learning::neural_network::NeuralNetwork
  • diff --git a/functions_func_d.html b/functions_func_d.html index 75ef471b5..a6b09489c 100644 --- a/functions_func_d.html +++ b/functions_func_d.html @@ -117,6 +117,7 @@ $(document).ready(function(){initNavTree('functions_func_d.html',''); initResiza
  • displayList() : data_structures::SkipList
  • divide() : uint128_t, uint256_t
  • draw_sample() : probability::geometric_dist::geometric_distribution
  • +
  • dsu() : dsu
  • diff --git a/functions_func_f.html b/functions_func_f.html index 602901844..0cb702c55 100644 --- a/functions_func_f.html +++ b/functions_func_f.html @@ -98,6 +98,7 @@ $(document).ready(function(){initNavTree('functions_func_f.html',''); initResiza
  • find_max() : binary_search_tree< T >
  • find_min() : binary_search_tree< T >
  • find_zero() : machine_learning::aystar_search::EightPuzzle< N >
  • +
  • findSet() : dsu
  • fit() : machine_learning::adaline, machine_learning::neural_network::NeuralNetwork
  • fit_from_csv() : machine_learning::neural_network::NeuralNetwork
  • front() : queue< Kind >
  • diff --git a/functions_func_g.html b/functions_func_g.html index f756722fb..f8ee7edac 100644 --- a/functions_func_g.html +++ b/functions_func_g.html @@ -100,7 +100,7 @@ $(document).ready(function(){initNavTree('functions_func_g.html',''); initResiza
  • generate_keys() : ciphers::HillCipher
  • generate_possible_moves() : machine_learning::aystar_search::EightPuzzle< N >
  • geometric_distribution() : probability::geometric_dist::geometric_distribution
  • -
  • get() : machine_learning::aystar_search::EightPuzzle< N >
  • +
  • get() : dsu, machine_learning::aystar_search::EightPuzzle< N >
  • get_all_words() : data_structures::trie_using_hashmap::Trie
  • get_char_idx() : ciphers::HillCipher
  • get_elements_inorder() : binary_search_tree< T >
  • @@ -109,6 +109,8 @@ $(document).ready(function(){initNavTree('functions_func_g.html',''); initResiza
  • get_idx_char() : ciphers::HillCipher
  • get_inverse() : ciphers::HillCipher
  • get_level_order() : operations_on_datastructures::reverse_binary_tree::BinaryTree
  • +
  • get_max() : dsu
  • +
  • get_min() : dsu
  • get_size() : machine_learning::aystar_search::EightPuzzle< N >
  • get_state() : machine_learning::aystar_search::EightPuzzle< N >
  • get_XY_from_csv() : machine_learning::neural_network::NeuralNetwork
  • @@ -130,6 +132,7 @@ $(document).ready(function(){initNavTree('functions_func_g.html',''); initResiza
  • GetMinItem() : data_structures::tree_234::Node
  • GetNextPossibleChild() : data_structures::tree_234::Node
  • getPageFault() : others::lru_cache::LRUCache
  • +
  • getParents() : dsu
  • GetRightmostChild() : data_structures::tree_234::Node
  • GetTreeMaxItem() : data_structures::tree_234::Tree234
  • GetTreeMinItem() : data_structures::tree_234::Tree234
  • diff --git a/functions_func_i.html b/functions_func_i.html index d88beb298..a39b9f3a5 100644 --- a/functions_func_i.html +++ b/functions_func_i.html @@ -122,6 +122,7 @@ $(document).ready(function(){initNavTree('functions_func_i.html',''); initResiza
  • isEmptyStack() : stack< Type >
  • IsFull() : data_structures::tree_234::Node
  • IsLeaf() : data_structures::tree_234::Node
  • +
  • isSame() : dsu
  • diff --git a/functions_func_s.html b/functions_func_s.html index 1c343f846..f3ec2c58e 100644 --- a/functions_func_s.html +++ b/functions_func_s.html @@ -109,7 +109,7 @@ $(document).ready(function(){initNavTree('functions_func_s.html',''); initResiza
  • SG() : range_queries::heavy_light_decomposition::SG< X >
  • show() : data_structures::list_array::list
  • single_predict() : machine_learning::neural_network::NeuralNetwork
  • -
  • size() : binary_search_tree< T >, data_structures::stack_using_queue::Stack, range_queries::perSegTree
  • +
  • size() : binary_search_tree< T >, data_structures::stack_using_queue::Stack, dsu, range_queries::perSegTree
  • SkipList() : data_structures::SkipList
  • Solution() : machine_learning::aystar_search::AyStarSearch< Puzzle >
  • sort() : data_structures::list_array::list
  • diff --git a/functions_func_u.html b/functions_func_u.html index 46ea0d16b..ee6c05122 100644 --- a/functions_func_u.html +++ b/functions_func_u.html @@ -95,6 +95,8 @@ $(document).ready(function(){initNavTree('functions_func_u.html',''); initResiza

    - u -

    diff --git a/functions_g.html b/functions_g.html index 9216c682b..9b35845c6 100644 --- a/functions_g.html +++ b/functions_g.html @@ -100,7 +100,7 @@ $(document).ready(function(){initNavTree('functions_g.html',''); initResizable()
  • generate_keys() : ciphers::HillCipher
  • generate_possible_moves() : machine_learning::aystar_search::EightPuzzle< N >
  • geometric_distribution() : probability::geometric_dist::geometric_distribution
  • -
  • get() : machine_learning::aystar_search::EightPuzzle< N >
  • +
  • get() : dsu, machine_learning::aystar_search::EightPuzzle< N >
  • get_all_words() : data_structures::trie_using_hashmap::Trie
  • get_char_idx() : ciphers::HillCipher
  • get_elements_inorder() : binary_search_tree< T >
  • @@ -109,6 +109,8 @@ $(document).ready(function(){initNavTree('functions_g.html',''); initResizable()
  • get_idx_char() : ciphers::HillCipher
  • get_inverse() : ciphers::HillCipher
  • get_level_order() : operations_on_datastructures::reverse_binary_tree::BinaryTree
  • +
  • get_max() : dsu
  • +
  • get_min() : dsu
  • get_size() : machine_learning::aystar_search::EightPuzzle< N >
  • get_state() : machine_learning::aystar_search::EightPuzzle< N >
  • get_XY_from_csv() : machine_learning::neural_network::NeuralNetwork
  • @@ -130,6 +132,7 @@ $(document).ready(function(){initNavTree('functions_g.html',''); initResizable()
  • GetMinItem() : data_structures::tree_234::Node
  • GetNextPossibleChild() : data_structures::tree_234::Node
  • getPageFault() : others::lru_cache::LRUCache
  • +
  • getParents() : dsu
  • GetRightmostChild() : data_structures::tree_234::Node
  • GetTreeMaxItem() : data_structures::tree_234::Tree234
  • GetTreeMinItem() : data_structures::tree_234::Tree234
  • diff --git a/functions_i.html b/functions_i.html index 7223e2521..c22a9ed4b 100644 --- a/functions_i.html +++ b/functions_i.html @@ -123,6 +123,7 @@ $(document).ready(function(){initNavTree('functions_i.html',''); initResizable()
  • isEndofWord : data_structures::trie
  • IsFull() : data_structures::tree_234::Node
  • IsLeaf() : data_structures::tree_234::Node
  • +
  • isSame() : dsu
  • items : data_structures::tree_234::Node
  • diff --git a/functions_m.html b/functions_m.html index 22f3bc5f7..87853487b 100644 --- a/functions_m.html +++ b/functions_m.html @@ -96,10 +96,12 @@ $(document).ready(function(){initNavTree('functions_m.html',''); initResizable()
  • m : graph::HKGraph
  • main_q : data_structures::stack_using_queue::Stack
  • mat_mul() : ciphers::HillCipher
  • +
  • maxElement : dsu
  • mean() : statistics::stats_computer1< T >, statistics::stats_computer2< T >
  • Merge() : data_structures::tree_234::Tree234
  • MergeNode() : data_structures::tree_234::Tree234
  • MergeNodeNotFull() : data_structures::tree_234::Tree234
  • +
  • minElement : dsu
  • MinHeap() : MinHeap
  • MinHeapify() : MinHeap
  • modInverse() : math::ncr_modulo_p::NCRModuloP
  • diff --git a/functions_p.html b/functions_p.html index 5d2ea4d3b..f6b7a9d05 100644 --- a/functions_p.html +++ b/functions_p.html @@ -93,7 +93,7 @@ $(document).ready(function(){initNavTree('functions_p.html',''); initResizable()
    Here is a list of all documented class members with links to the class documentation for each member:

    - p -