Documentation for f821fae698

This commit is contained in:
github-actions
2021-10-24 15:48:54 +00:00
parent 9bcef17741
commit bd3ee55c22
327 changed files with 6557 additions and 2786 deletions

916
dd/d1f/classdsu.html Normal file
View File

@@ -0,0 +1,916 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: dsu Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('dd/d1f/classdsu.html','../../'); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="../../d0/dcb/classdsu-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">dsu Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Disjoint sets union data structure, class based representation.
<a href="../../dd/d1f/classdsu.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a126e3002a464e53cd54b07ba56482a72"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72">dsu</a> (uint64_t n)</td></tr>
<tr class="memdesc:a126e3002a464e53cd54b07ba56482a72"><td class="mdescLeft">&#160;</td><td class="mdescRight">contructor for initialising all data members. <a href="../../dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72">More...</a><br /></td></tr>
<tr class="separator:a126e3002a464e53cd54b07ba56482a72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16851f78fe390fc1430905c83d6a2f1c"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a> (uint64_t i)</td></tr>
<tr class="memdesc:a16851f78fe390fc1430905c83d6a2f1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Method to find the representative of the set to which i belongs to, T(n) = O(1) <a href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">More...</a><br /></td></tr>
<tr class="separator:a16851f78fe390fc1430905c83d6a2f1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ac30c07abca2aaa3b291504c25c3559"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a6ac30c07abca2aaa3b291504c25c3559">UnionSet</a> (uint64_t i, uint64_t j)</td></tr>
<tr class="memdesc:a6ac30c07abca2aaa3b291504c25c3559"><td class="mdescLeft">&#160;</td><td class="mdescRight">Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative. <a href="../../dd/d1f/classdsu.html#a6ac30c07abca2aaa3b291504c25c3559">More...</a><br /></td></tr>
<tr class="separator:a6ac30c07abca2aaa3b291504c25c3559"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64d25c5986742f7c234ed449b2ff7303"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a> (uint64_t i, uint64_t j)</td></tr>
<tr class="memdesc:a64d25c5986742f7c234ed449b2ff7303"><td class="mdescLeft">&#160;</td><td class="mdescRight">A utility function which check whether i and j belongs to same set or not. <a href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">More...</a><br /></td></tr>
<tr class="separator:a64d25c5986742f7c234ed449b2ff7303"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ce2672c570f4235eafddb0c9a58115a"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a0ce2672c570f4235eafddb0c9a58115a">get</a> (uint64_t i)</td></tr>
<tr class="memdesc:a0ce2672c570f4235eafddb0c9a58115a"><td class="mdescLeft">&#160;</td><td class="mdescRight">prints the minimum, maximum and size of the set to which i belongs to <a href="../../dd/d1f/classdsu.html#a0ce2672c570f4235eafddb0c9a58115a">More...</a><br /></td></tr>
<tr class="separator:a0ce2672c570f4235eafddb0c9a58115a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c24228b0f2f49220133fb8c3566a55c"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c">size</a> (uint64_t i)</td></tr>
<tr class="memdesc:a1c24228b0f2f49220133fb8c3566a55c"><td class="mdescLeft">&#160;</td><td class="mdescRight">A utility function that returns the size of the set to which i belongs to. <a href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c">More...</a><br /></td></tr>
<tr class="separator:a1c24228b0f2f49220133fb8c3566a55c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a696141b8b092466767f4bfe1c5e46cde"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde">get_max</a> (uint64_t i)</td></tr>
<tr class="memdesc:a696141b8b092466767f4bfe1c5e46cde"><td class="mdescLeft">&#160;</td><td class="mdescRight">A utility function that returns the max element of the set to which i belongs to. <a href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde">More...</a><br /></td></tr>
<tr class="separator:a696141b8b092466767f4bfe1c5e46cde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac713a5b496d0405c82e2808a85e58415"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415">get_min</a> (uint64_t i)</td></tr>
<tr class="memdesc:ac713a5b496d0405c82e2808a85e58415"><td class="mdescLeft">&#160;</td><td class="mdescRight">A utility function that returns the min element of the set to which i belongs to. <a href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415">More...</a><br /></td></tr>
<tr class="separator:ac713a5b496d0405c82e2808a85e58415"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a126e3002a464e53cd54b07ba56482a72"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72">dsu</a> (uint64_t n)</td></tr>
<tr class="memdesc:a126e3002a464e53cd54b07ba56482a72"><td class="mdescLeft">&#160;</td><td class="mdescRight">constructor for initialising all data members <a href="../../dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72">More...</a><br /></td></tr>
<tr class="separator:a126e3002a464e53cd54b07ba56482a72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16851f78fe390fc1430905c83d6a2f1c"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a> (uint64_t i)</td></tr>
<tr class="memdesc:a16851f78fe390fc1430905c83d6a2f1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Method to find the representative of the set to which i belongs to, T(n) = O(logN) <a href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">More...</a><br /></td></tr>
<tr class="separator:a16851f78fe390fc1430905c83d6a2f1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81897528bdb53fd5e796d75d7dbc430f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f">unionSet</a> (uint64_t i, uint64_t j)</td></tr>
<tr class="memdesc:a81897528bdb53fd5e796d75d7dbc430f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative. <a href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f">More...</a><br /></td></tr>
<tr class="separator:a81897528bdb53fd5e796d75d7dbc430f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64d25c5986742f7c234ed449b2ff7303"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a> (uint64_t i, uint64_t j)</td></tr>
<tr class="memdesc:a64d25c5986742f7c234ed449b2ff7303"><td class="mdescLeft">&#160;</td><td class="mdescRight">A utility function which check whether i and j belongs to same set or not. <a href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">More...</a><br /></td></tr>
<tr class="separator:a64d25c5986742f7c234ed449b2ff7303"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8ee27083a3c2e2df80755165a2ec280"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280">getParents</a> (uint64_t i)</td></tr>
<tr class="memdesc:ab8ee27083a3c2e2df80755165a2ec280"><td class="mdescLeft">&#160;</td><td class="mdescRight">Method to print all the parents of i, or the path from i to representative. <a href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280">More...</a><br /></td></tr>
<tr class="separator:ab8ee27083a3c2e2df80755165a2ec280"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a1ef0b0462a0dda63514f641cbb7dd8cb"><td class="memItemLeft" align="right" valign="top"><a id="a1ef0b0462a0dda63514f641cbb7dd8cb" name="a1ef0b0462a0dda63514f641cbb7dd8cb"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>p</b></td></tr>
<tr class="memdesc:a1ef0b0462a0dda63514f641cbb7dd8cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">keeps track of the parent of ith element <br /></td></tr>
<tr class="separator:a1ef0b0462a0dda63514f641cbb7dd8cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bf54d33fba178998dbbe4c57f2e9429"><td class="memItemLeft" align="right" valign="top"><a id="a4bf54d33fba178998dbbe4c57f2e9429" name="a4bf54d33fba178998dbbe4c57f2e9429"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>depth</b></td></tr>
<tr class="memdesc:a4bf54d33fba178998dbbe4c57f2e9429"><td class="mdescLeft">&#160;</td><td class="mdescRight">tracks the depth(rank) of i in the tree <br /></td></tr>
<tr class="separator:a4bf54d33fba178998dbbe4c57f2e9429"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0dc3e17e49fe19b159b4ea4096d7b55"><td class="memItemLeft" align="right" valign="top"><a id="ac0dc3e17e49fe19b159b4ea4096d7b55" name="ac0dc3e17e49fe19b159b4ea4096d7b55"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>setSize</b></td></tr>
<tr class="memdesc:ac0dc3e17e49fe19b159b4ea4096d7b55"><td class="mdescLeft">&#160;</td><td class="mdescRight">size of each chunk(set) <br /></td></tr>
<tr class="separator:ac0dc3e17e49fe19b159b4ea4096d7b55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ade6f16c418fc98b54452f7b0252a53"><td class="memItemLeft" align="right" valign="top"><a id="a4ade6f16c418fc98b54452f7b0252a53" name="a4ade6f16c418fc98b54452f7b0252a53"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>maxElement</b></td></tr>
<tr class="memdesc:a4ade6f16c418fc98b54452f7b0252a53"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum of each set to which i belongs to <br /></td></tr>
<tr class="separator:a4ade6f16c418fc98b54452f7b0252a53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d77aad7fc39fe7140d834cd347e5c63"><td class="memItemLeft" align="right" valign="top"><a id="a1d77aad7fc39fe7140d834cd347e5c63" name="a1d77aad7fc39fe7140d834cd347e5c63"></a>
<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>minElement</b></td></tr>
<tr class="memdesc:a1d77aad7fc39fe7140d834cd347e5c63"><td class="mdescLeft">&#160;</td><td class="mdescRight">minimum of each set to which i belongs to <br /></td></tr>
<tr class="separator:a1d77aad7fc39fe7140d834cd347e5c63"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Disjoint sets union data structure, class based representation. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>number of elements </td></tr>
</table>
</dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a126e3002a464e53cd54b07ba56482a72" name="a126e3002a464e53cd54b07ba56482a72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a126e3002a464e53cd54b07ba56482a72">&#9670;&nbsp;</a></span>dsu() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">dsu::dsu </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>n</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>contructor for initialising all data members. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>number of elements </td></tr>
</table>
</dd>
</dl>
<p >initially, all of them are their own parents</p>
<p >initially all have depth are equals to zero</p>
<p >initially set size will be equals to one</p>
<div class="fragment"><div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>.assign(n, 0);<span class="comment"></span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> /// initially, all of them are their own parents</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; n; i++) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] = i;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }<span class="comment"></span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment"> /// initially all have depth are equals to zero</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>.assign(n, 0);</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>.assign(n, 0);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>.assign(n, 0);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; n; i++) {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[i] = 0;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>[i] = i;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[i] = i;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>.assign(n, 0);<span class="comment"></span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="comment"> /// initially set size will be equals to one</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment"></span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; n; i++) {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[i] = 1;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> }</div>
<div class="ttc" id="aclassdsu_html_a1d77aad7fc39fe7140d834cd347e5c63"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">dsu::minElement</a></div><div class="ttdeci">vector&lt; uint64_t &gt; minElement</div><div class="ttdoc">minimum of each set to which i belongs to</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:39</div></div>
<div class="ttc" id="aclassdsu_html_a1ef0b0462a0dda63514f641cbb7dd8cb"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">dsu::p</a></div><div class="ttdeci">vector&lt; uint64_t &gt; p</div><div class="ttdoc">keeps track of the parent of ith element</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:35</div></div>
<div class="ttc" id="aclassdsu_html_a4ade6f16c418fc98b54452f7b0252a53"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">dsu::maxElement</a></div><div class="ttdeci">vector&lt; uint64_t &gt; maxElement</div><div class="ttdoc">maximum of each set to which i belongs to</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:38</div></div>
<div class="ttc" id="aclassdsu_html_a4bf54d33fba178998dbbe4c57f2e9429"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">dsu::depth</a></div><div class="ttdeci">vector&lt; uint64_t &gt; depth</div><div class="ttdoc">tracks the depth(rank) of i in the tree</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:36</div></div>
<div class="ttc" id="aclassdsu_html_ac0dc3e17e49fe19b159b4ea4096d7b55"><div class="ttname"><a href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">dsu::setSize</a></div><div class="ttdeci">vector&lt; uint64_t &gt; setSize</div><div class="ttdoc">size of each chunk(set)</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:37</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a126e3002a464e53cd54b07ba56482a72" name="a126e3002a464e53cd54b07ba56482a72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a126e3002a464e53cd54b07ba56482a72">&#9670;&nbsp;</a></span>dsu() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">dsu::dsu </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>n</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>constructor for initialising all data members </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">n</td><td>number of elements </td></tr>
</table>
</dd>
</dl>
<p >initially all of them are their own parents</p>
<div class="fragment"><div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>.assign(n, 0);<span class="comment"></span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> /// initially all of them are their own parents</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>.assign(n, 0);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>.assign(n, 0);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; n; i++) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] = i;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[i] = 0;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[i] = 1;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a16851f78fe390fc1430905c83d6a2f1c" name="a16851f78fe390fc1430905c83d6a2f1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16851f78fe390fc1430905c83d6a2f1c">&#9670;&nbsp;</a></span>findSet() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint64_t dsu::findSet </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Method to find the representative of the set to which i belongs to, T(n) = O(1) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>representative of the set to which i belongs to. </dd></dl>
<p >using path compression</p>
<div class="fragment"><div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> {<span class="comment"></span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> /// using path compression</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] == i) {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">return</span> i;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> }</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">return</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i]));</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> }</div>
<div class="ttc" id="aclassdsu_html_a16851f78fe390fc1430905c83d6a2f1c"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">dsu::findSet</a></div><div class="ttdeci">uint64_t findSet(uint64_t i)</div><div class="ttdoc">Method to find the representative of the set to which i belongs to, T(n) = O(1)</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:73</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a16851f78fe390fc1430905c83d6a2f1c_cgraph.svg" width="103" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a16851f78fe390fc1430905c83d6a2f1c" name="a16851f78fe390fc1430905c83d6a2f1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16851f78fe390fc1430905c83d6a2f1c">&#9670;&nbsp;</a></span>findSet() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint64_t dsu::findSet </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Method to find the representative of the set to which i belongs to, T(n) = O(logN) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>representative of the set to which i belongs to </dd></dl>
<p >using union-rank</p>
<div class="fragment"><div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> {<span class="comment"></span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment"> /// using union-rank</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="comment"></span> <span class="keywordflow">while</span> (i != <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i]) {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> i = <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i];</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> }</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> i;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a0ce2672c570f4235eafddb0c9a58115a" name="a0ce2672c570f4235eafddb0c9a58115a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ce2672c570f4235eafddb0c9a58115a">&#9670;&nbsp;</a></span>get()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt; dsu::get </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>prints the minimum, maximum and size of the set to which i belongs to </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector&lt;uint64_t&gt;</a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.push_back(<a class="code hl_function" href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415">get_min</a>(i));</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.push_back(<a class="code hl_function" href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde">get_max</a>(i));</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.push_back(<a class="code hl_function" href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c">size</a>(i));</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> }</div>
<div class="ttc" id="aclassdsu_html_a1c24228b0f2f49220133fb8c3566a55c"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c">dsu::size</a></div><div class="ttdeci">uint64_t size(uint64_t i)</div><div class="ttdoc">A utility function that returns the size of the set to which i belongs to.</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:148</div></div>
<div class="ttc" id="aclassdsu_html_a696141b8b092466767f4bfe1c5e46cde"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde">dsu::get_max</a></div><div class="ttdeci">uint64_t get_max(uint64_t i)</div><div class="ttdoc">A utility function that returns the max element of the set to which i belongs to.</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:155</div></div>
<div class="ttc" id="aclassdsu_html_ac713a5b496d0405c82e2808a85e58415"><div class="ttname"><a href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415">dsu::get_min</a></div><div class="ttdeci">uint64_t get_min(uint64_t i)</div><div class="ttdoc">A utility function that returns the min element of the set to which i belongs to.</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:162</div></div>
<div class="ttc" id="amatrix__exponentiation_8cpp_html_ad8389ed58fd0ec66df248014775ad1fa"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a></div><div class="ttdeci">ll ans(ll n)</div><div class="ttdef"><b>Definition:</b> matrix_exponentiation.cpp:91</div></div>
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a0ce2672c570f4235eafddb0c9a58115a_cgraph.svg" width="371" height="190"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a696141b8b092466767f4bfe1c5e46cde" name="a696141b8b092466767f4bfe1c5e46cde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a696141b8b092466767f4bfe1c5e46cde">&#9670;&nbsp;</a></span>get_max()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint64_t dsu::get_max </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>A utility function that returns the max element of the set to which i belongs to. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>maximum of the set to which i belongs to </dd></dl>
<div class="fragment"><div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>[<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i)]; }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a696141b8b092466767f4bfe1c5e46cde_cgraph.svg" width="254" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="ac713a5b496d0405c82e2808a85e58415" name="ac713a5b496d0405c82e2808a85e58415"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac713a5b496d0405c82e2808a85e58415">&#9670;&nbsp;</a></span>get_min()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint64_t dsu::get_min </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>A utility function that returns the min element of the set to which i belongs to. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>minimum of the set to which i belongs to </dd></dl>
<div class="fragment"><div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i)]; }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_ac713a5b496d0405c82e2808a85e58415_cgraph.svg" width="250" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="ab8ee27083a3c2e2df80755165a2ec280" name="ab8ee27083a3c2e2df80755165a2ec280"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8ee27083a3c2e2df80755165a2ec280">&#9670;&nbsp;</a></span>getParents()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>&lt; uint64_t &gt; dsu::getParents </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Method to print all the parents of i, or the path from i to representative. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector&lt;uint64_t&gt;</a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">while</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] != i) {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.push_back(i);</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> i = <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i];</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> }</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.push_back(i);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_ab8ee27083a3c2e2df80755165a2ec280_cgraph.svg" width="219" height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a64d25c5986742f7c234ed449b2ff7303" name="a64d25c5986742f7c234ed449b2ff7303"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a64d25c5986742f7c234ed449b2ff7303">&#9670;&nbsp;</a></span>isSame() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool dsu::isSame </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>j</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>A utility function which check whether i and j belongs to same set or not. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
<tr><td class="paramname">j</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if element <code>i</code> and <code>j</code> ARE in the same set </dd>
<dd>
<code>false</code> if element <code>i</code> and <code>j</code> are NOT in same set </dd></dl>
<div class="fragment"><div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i) == <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j)) {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> }</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.svg" width="247" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a64d25c5986742f7c234ed449b2ff7303" name="a64d25c5986742f7c234ed449b2ff7303"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a64d25c5986742f7c234ed449b2ff7303">&#9670;&nbsp;</a></span>isSame() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool dsu::isSame </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>j</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>A utility function which check whether i and j belongs to same set or not. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
<tr><td class="paramname">j</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if element i and j are in same set </dd>
<dd>
<code>false</code> if element i and j are not in same set </dd></dl>
<div class="fragment"><div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i) == <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j)) {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a64d25c5986742f7c234ed449b2ff7303_cgraph.svg" width="247" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a1c24228b0f2f49220133fb8c3566a55c" name="a1c24228b0f2f49220133fb8c3566a55c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c24228b0f2f49220133fb8c3566a55c">&#9670;&nbsp;</a></span>size()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint64_t dsu::size </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>A utility function that returns the size of the set to which i belongs to. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>size of the set to which i belongs to </dd></dl>
<div class="fragment"><div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>{ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i)]; }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a1c24228b0f2f49220133fb8c3566a55c_cgraph.svg" width="226" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a6ac30c07abca2aaa3b291504c25c3559" name="a6ac30c07abca2aaa3b291504c25c3559"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ac30c07abca2aaa3b291504c25c3559">&#9670;&nbsp;</a></span>UnionSet()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void dsu::UnionSet </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>j</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
<tr><td class="paramname">j</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<p >check if both belongs to the same set or not</p>
<p >always keeping the min as x shallow tree</p>
<p >making the shallower root's parent the deeper root</p>
<p >if same depth, then increase one's depth</p>
<p >total size of the resultant set</p>
<p >changing the maximum elements</p>
<div class="fragment"><div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> {<span class="comment"></span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"> /// check if both belongs to the same set or not</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a>(i, j)) {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// we find the representative of the i and j</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> uint64_t x = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> uint64_t y = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"></span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"> /// always keeping the min as x</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> /// shallow tree</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] &gt; <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(x, y);</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> }<span class="comment"></span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment"> /// making the shallower root&#39;s parent the deeper root</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[x] = y;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"></span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"> /// if same depth, then increase one&#39;s depth</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] == <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]++;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> }<span class="comment"></span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="comment"> /// total size of the resultant set</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[y] += <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[x];<span class="comment"></span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="comment"> /// changing the maximum elements</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>[y] = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a>(<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>[x], <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>[y]);</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[y] = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a>(<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[x], <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[y]);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> }</div>
<div class="ttc" id="aclassdsu_html_a64d25c5986742f7c234ed449b2ff7303"><div class="ttname"><a href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">dsu::isSame</a></div><div class="ttdeci">bool isSame(uint64_t i, uint64_t j)</div><div class="ttdoc">A utility function which check whether i and j belongs to same set or not.</div><div class="ttdef"><b>Definition:</b> dsu_path_compression.cpp:123</div></div>
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
<div class="ttc" id="amin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/min.html">std::min</a></div><div class="ttdeci">T min(T... args)</div></div>
<div class="ttc" id="aswap_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a></div><div class="ttdeci">T swap(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a6ac30c07abca2aaa3b291504c25c3559_cgraph.svg" width="400" height="239"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<a id="a81897528bdb53fd5e796d75d7dbc430f" name="a81897528bdb53fd5e796d75d7dbc430f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81897528bdb53fd5e796d75d7dbc430f">&#9670;&nbsp;</a></span>unionSet()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void dsu::unionSet </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>j</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Method that combines two disjoint sets to which i and j belongs to and make a single set having a common representative. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">i</td><td>element of some set </td></tr>
<tr><td class="paramname">j</td><td>element of some set </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<p >checks if both belongs to same set or not</p>
<p >we find representative of the i and j</p>
<p >always keeping the min as x in order to create a shallow tree</p>
<p >making the shallower tree, root parent of the deeper root</p>
<p >if same depth, then increase one's depth</p>
<p >total size of the resultant set</p>
<div class="fragment"><div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> {<span class="comment"></span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"> /// checks if both belongs to same set or not</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a>(i, j)) {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> }<span class="comment"></span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment"> /// we find representative of the i and j</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment"></span> uint64_t x = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> uint64_t y = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment"></span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"> /// always keeping the min as x</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment"> /// in order to create a shallow tree</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] &gt; <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/swap.html">std::swap</a>(x, y);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> }<span class="comment"></span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> /// making the shallower tree, root parent of the deeper root</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[x] = y;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"></span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> /// if same depth, then increase one&#39;s depth</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment"></span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] == <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]++;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }<span class="comment"></span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="comment"> /// total size of the resultant set</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment"></span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[y] += <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[x];</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d1f/classdsu_a81897528bdb53fd5e796d75d7dbc430f_cgraph.svg" width="399" height="138"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>data_structures/<a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html">dsu_path_compression.cpp</a></li>
<li>data_structures/<a class="el" href="../../df/d28/dsu__union__rank_8cpp.html">dsu_union_rank.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dd/d1f/classdsu.html">dsu</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
</ul>
</div>
</body>
</html>

21
dd/d1f/classdsu.js Normal file
View File

@@ -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 ]
];

View File

@@ -0,0 +1,8 @@
<map id="dsu::get" name="dsu::get">
<area shape="rect" id="node1" title="prints the minimum, maximum and size of the set to which i belongs to" alt="" coords="5,81,75,108"/>
<area shape="rect" id="node2" href="$d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" title=" " alt="" coords="152,5,196,32"/>
<area shape="rect" id="node3" href="$dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde" title="A utility function that returns the max element of the set to which i belongs to." alt="" coords="123,56,225,83"/>
<area shape="rect" id="node5" href="$dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415" title="A utility function that returns the min element of the set to which i belongs to." alt="" coords="125,107,223,133"/>
<area shape="rect" id="node6" href="$dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c" title="A utility function that returns the size of the set to which i belongs to." alt="" coords="137,157,211,184"/>
<area shape="rect" id="node4" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="273,107,365,133"/>
</map>

View File

@@ -0,0 +1 @@
490a8d37b5f0cb86c4f3a58c56b5ea6d

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::get Pages: 1 -->
<svg width="278pt" height="142pt"
viewBox="0.00 0.00 278.00 142.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 138)">
<title>dsu::get</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 274,-138 274,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="prints the minimum, maximum and size of the set to which i belongs to">
<polygon fill="#bfbfbf" stroke="black" points="0,-57.5 0,-76.5 52,-76.5 52,-57.5 0,-57.5"/>
<text text-anchor="middle" x="26" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::get</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" target="_top" xlink:title=" ">
<polygon fill="white" stroke="black" points="110,-114.5 110,-133.5 143,-133.5 143,-114.5 110,-114.5"/>
<text text-anchor="middle" x="126.5" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M41.82,-76.74C54.04,-84.65 71.91,-95.94 88,-105 92.04,-107.28 96.39,-109.6 100.65,-111.8"/>
<polygon fill="midnightblue" stroke="midnightblue" points="99.14,-114.96 109.65,-116.35 102.31,-108.71 99.14,-114.96"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde" target="_top" xlink:title="A utility function that returns the max element of the set to which i belongs to.">
<polygon fill="white" stroke="black" points="88,-76.5 88,-95.5 165,-95.5 165,-76.5 88,-76.5"/>
<text text-anchor="middle" x="126.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::get_max</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M52.11,-71.84C59.98,-73.36 68.94,-75.09 77.83,-76.81"/>
<polygon fill="midnightblue" stroke="midnightblue" points="77.3,-80.27 87.78,-78.72 78.62,-73.39 77.3,-80.27"/>
</g>
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a xlink:href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415" target="_top" xlink:title="A utility function that returns the min element of the set to which i belongs to.">
<polygon fill="white" stroke="black" points="89.5,-38.5 89.5,-57.5 163.5,-57.5 163.5,-38.5 89.5,-38.5"/>
<text text-anchor="middle" x="126.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::get_min</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge5" class="edge">
<title>Node1&#45;&gt;Node5</title>
<path fill="none" stroke="midnightblue" d="M52.11,-62.16C60.4,-60.56 69.9,-58.73 79.25,-56.92"/>
<polygon fill="midnightblue" stroke="midnightblue" points="80.13,-60.32 89.28,-54.99 78.8,-53.44 80.13,-60.32"/>
</g>
<!-- Node6 -->
<g id="node6" class="node">
<title>Node6</title>
<g id="a_node6"><a xlink:href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c" target="_top" xlink:title="A utility function that returns the size of the set to which i belongs to.">
<polygon fill="white" stroke="black" points="98.5,-0.5 98.5,-19.5 154.5,-19.5 154.5,-0.5 98.5,-0.5"/>
<text text-anchor="middle" x="126.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::size</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge7" class="edge">
<title>Node1&#45;&gt;Node6</title>
<path fill="none" stroke="midnightblue" d="M41.82,-57.26C54.04,-49.35 71.91,-38.06 88,-29 90.86,-27.39 93.88,-25.76 96.9,-24.16"/>
<polygon fill="midnightblue" stroke="midnightblue" points="98.58,-27.23 105.86,-19.54 95.37,-21.01 98.58,-27.23"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="201,-38.5 201,-57.5 270,-57.5 270,-38.5 201,-38.5"/>
<text text-anchor="middle" x="235.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node3&#45;&gt;Node4 -->
<g id="edge3" class="edge">
<title>Node3&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M154.5,-76.41C167.68,-71.73 183.73,-66.03 197.98,-60.97"/>
<polygon fill="midnightblue" stroke="midnightblue" points="199.26,-64.23 207.51,-57.59 196.91,-57.63 199.26,-64.23"/>
</g>
<!-- Node4&#45;&gt;Node4 -->
<g id="edge4" class="edge">
<title>Node4&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M218.85,-57.76C210.76,-66.57 216.3,-76 235.5,-76 247.5,-76 254.16,-72.31 255.5,-67.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="258.74,-66.05 252.15,-57.76 252.12,-68.35 258.74,-66.05"/>
</g>
<!-- Node5&#45;&gt;Node4 -->
<g id="edge6" class="edge">
<title>Node5&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M163.73,-48C172.35,-48 181.65,-48 190.58,-48"/>
<polygon fill="midnightblue" stroke="midnightblue" points="190.84,-51.5 200.84,-48 190.84,-44.5 190.84,-51.5"/>
</g>
<!-- Node6&#45;&gt;Node4 -->
<g id="edge8" class="edge">
<title>Node6&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M154.5,-19.59C167.68,-24.27 183.73,-29.97 197.98,-35.03"/>
<polygon fill="midnightblue" stroke="midnightblue" points="196.91,-38.37 207.51,-38.41 199.26,-31.77 196.91,-38.37"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,3 @@
<map id="dsu::findSet" name="dsu::findSet">
<area shape="rect" id="node1" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="5,29,97,56"/>
</map>

View File

@@ -0,0 +1 @@
68901429c8095fec6a63c6963f3a6644

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::findSet Pages: 1 -->
<svg width="77pt" height="46pt"
viewBox="0.00 0.00 77.00 46.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 42)">
<title>dsu::findSet</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-42 73,-42 73,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 69,-19.5 69,-0.5 0,-0.5"/>
<text text-anchor="middle" x="34.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="midnightblue" d="M24.02,-19.76C18.92,-28.57 22.41,-38 34.5,-38 41.86,-38 46.04,-34.5 47.02,-29.77"/>
<polygon fill="midnightblue" stroke="midnightblue" points="50.41,-28.86 44.98,-19.76 43.55,-30.25 50.41,-28.86"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,4 @@
<map id="dsu::size" name="dsu::size">
<area shape="rect" id="node1" title="A utility function that returns the size of the set to which i belongs to." alt="" coords="5,29,80,56"/>
<area shape="rect" id="node2" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="128,29,220,56"/>
</map>

View File

@@ -0,0 +1 @@
623f7b626b35cfcf465d13ea8247d333

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::size Pages: 1 -->
<svg width="169pt" height="46pt"
viewBox="0.00 0.00 169.00 46.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 42)">
<title>dsu::size</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-42 165,-42 165,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="A utility function that returns the size of the set to which i belongs to.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 56,-19.5 56,-0.5 0,-0.5"/>
<text text-anchor="middle" x="28" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::size</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="92,-0.5 92,-19.5 161,-19.5 161,-0.5 92,-0.5"/>
<text text-anchor="middle" x="126.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M56.14,-10C64.07,-10 72.95,-10 81.64,-10"/>
<polygon fill="midnightblue" stroke="midnightblue" points="81.69,-13.5 91.69,-10 81.69,-6.5 81.69,-13.5"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M111.4,-19.76C104.05,-28.57 109.08,-38 126.5,-38 137.39,-38 143.44,-34.31 144.65,-29.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="147.95,-28.24 141.6,-19.76 141.28,-30.35 147.95,-28.24"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,4 @@
<map id="dsu::isSame" name="dsu::isSame">
<area shape="rect" id="node1" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="5,29,101,56"/>
<area shape="rect" id="node2" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="149,29,241,56"/>
</map>

View File

@@ -0,0 +1 @@
96cd263a1b02117642467e38dc9d3ca0

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::isSame Pages: 1 -->
<svg width="185pt" height="46pt"
viewBox="0.00 0.00 185.00 46.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 42)">
<title>dsu::isSame</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-42 181,-42 181,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="A utility function which check whether i and j belongs to same set or not.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 72,-19.5 72,-0.5 0,-0.5"/>
<text text-anchor="middle" x="36" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="108,-0.5 108,-19.5 177,-19.5 177,-0.5 108,-0.5"/>
<text text-anchor="middle" x="142.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M72.09,-10C80.27,-10 89.07,-10 97.58,-10"/>
<polygon fill="midnightblue" stroke="midnightblue" points="97.74,-13.5 107.74,-10 97.74,-6.5 97.74,-13.5"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M126.16,-19.76C118.21,-28.57 123.66,-38 142.5,-38 154.27,-38 160.82,-34.31 162.13,-29.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="165.38,-28.09 158.84,-19.76 158.76,-30.35 165.38,-28.09"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,4 @@
<map id="dsu::get_max" name="dsu::get_max">
<area shape="rect" id="node1" title="A utility function that returns the max element of the set to which i belongs to." alt="" coords="5,29,108,56"/>
<area shape="rect" id="node2" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="156,29,248,56"/>
</map>

View File

@@ -0,0 +1 @@
831d13dfb388de7742825db431cdc93a

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::get_max Pages: 1 -->
<svg width="190pt" height="46pt"
viewBox="0.00 0.00 190.00 46.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 42)">
<title>dsu::get_max</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-42 186,-42 186,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="A utility function that returns the max element of the set to which i belongs to.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 77,-19.5 77,-0.5 0,-0.5"/>
<text text-anchor="middle" x="38.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::get_max</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="113,-0.5 113,-19.5 182,-19.5 182,-0.5 113,-0.5"/>
<text text-anchor="middle" x="147.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M77.22,-10C85.44,-10 94.19,-10 102.62,-10"/>
<polygon fill="midnightblue" stroke="midnightblue" points="102.68,-13.5 112.68,-10 102.68,-6.5 102.68,-13.5"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M130.85,-19.76C122.76,-28.57 128.3,-38 147.5,-38 159.5,-38 166.16,-34.31 167.5,-29.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="170.74,-28.05 164.15,-19.76 164.12,-30.35 170.74,-28.05"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,8 @@
<map id="dsu::UnionSet" name="dsu::UnionSet">
<area shape="rect" id="node1" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="5,105,111,132"/>
<area shape="rect" id="node2" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="303,29,395,56"/>
<area shape="rect" id="node3" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="159,55,255,81"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="171,105,243,132"/>
<area shape="rect" id="node5" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/min.html#" title=" " alt="" coords="172,156,241,183"/>
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="167,207,246,233"/>
</map>

View File

@@ -0,0 +1 @@
6e96a1598377c2c50062e9990a4335f6

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::UnionSet Pages: 1 -->
<svg width="300pt" height="179pt"
viewBox="0.00 0.00 300.00 179.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 175)">
<title>dsu::UnionSet</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-175 296,-175 296,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 79,-95.5 79,-76.5 0,-76.5"/>
<text text-anchor="middle" x="39.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::UnionSet</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="223,-133.5 223,-152.5 292,-152.5 292,-133.5 223,-133.5"/>
<text text-anchor="middle" x="257.5" y="-140.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M48.96,-95.6C61.68,-109.24 87.24,-133.6 115,-143 146.5,-153.67 184.25,-153.05 212.84,-150.11"/>
<polygon fill="midnightblue" stroke="midnightblue" points="213.4,-153.56 222.93,-148.93 212.59,-146.61 213.4,-153.56"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
<polygon fill="white" stroke="black" points="115,-114.5 115,-133.5 187,-133.5 187,-114.5 115,-114.5"/>
<text text-anchor="middle" x="151" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge3" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M68.13,-95.59C81.62,-100.27 98.04,-105.97 112.63,-111.03"/>
<polygon fill="midnightblue" stroke="midnightblue" points="111.78,-114.44 122.38,-114.41 114.08,-107.83 111.78,-114.44"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/max.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="124,-76.5 124,-95.5 178,-95.5 178,-76.5 124,-76.5"/>
<text text-anchor="middle" x="151" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::max</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge5" class="edge">
<title>Node1&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M79.11,-86C90.3,-86 102.49,-86 113.55,-86"/>
<polygon fill="midnightblue" stroke="midnightblue" points="113.75,-89.5 123.75,-86 113.75,-82.5 113.75,-89.5"/>
</g>
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/min.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="125,-38.5 125,-57.5 177,-57.5 177,-38.5 125,-38.5"/>
<text text-anchor="middle" x="151" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::min</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge6" class="edge">
<title>Node1&#45;&gt;Node5</title>
<path fill="none" stroke="midnightblue" d="M68.13,-76.41C82.48,-71.43 100.14,-65.3 115.39,-60.01"/>
<polygon fill="midnightblue" stroke="midnightblue" points="116.7,-63.26 125,-56.68 114.4,-56.65 116.7,-63.26"/>
</g>
<!-- Node6 -->
<g id="node6" class="node">
<title>Node6</title>
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="121.5,-0.5 121.5,-19.5 180.5,-19.5 180.5,-0.5 121.5,-0.5"/>
<text text-anchor="middle" x="151" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node6 -->
<g id="edge7" class="edge">
<title>Node1&#45;&gt;Node6</title>
<path fill="none" stroke="midnightblue" d="M51.96,-76.33C66.24,-64.49 91.63,-44.15 115,-29 117.31,-27.5 119.76,-26.01 122.23,-24.55"/>
<polygon fill="midnightblue" stroke="midnightblue" points="124.16,-27.48 131.16,-19.53 120.73,-21.38 124.16,-27.48"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M241.16,-152.76C233.21,-161.57 238.66,-171 257.5,-171 269.27,-171 275.82,-167.31 277.13,-162.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="280.38,-161.09 273.84,-152.76 273.76,-163.35 280.38,-161.09"/>
</g>
<!-- Node3&#45;&gt;Node2 -->
<g id="edge4" class="edge">
<title>Node3&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M187.09,-130.38C195.36,-131.88 204.27,-133.5 212.86,-135.07"/>
<polygon fill="midnightblue" stroke="midnightblue" points="212.28,-138.52 222.74,-136.86 213.53,-131.63 212.28,-138.52"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -0,0 +1,6 @@
<map id="dsu::unionSet" name="dsu::unionSet">
<area shape="rect" id="node1" title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com..." alt="" coords="5,55,109,81"/>
<area shape="rect" id="node2" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="301,29,393,56"/>
<area shape="rect" id="node3" href="$dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" title="A utility function which check whether i and j belongs to same set or not." alt="" coords="157,55,253,81"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="166,105,245,132"/>
</map>

View File

@@ -0,0 +1 @@
1b0376de3bec490e5775b64645a04801

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::unionSet Pages: 1 -->
<svg width="299pt" height="103pt"
viewBox="0.00 0.00 299.00 103.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 99)">
<title>dsu::unionSet</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-99 295,-99 295,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Method that combines two disjoint sets to which i and j belongs to and make a single set having a com...">
<polygon fill="#bfbfbf" stroke="black" points="0,-38.5 0,-57.5 78,-57.5 78,-38.5 0,-38.5"/>
<text text-anchor="middle" x="39" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::unionSet</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="222,-57.5 222,-76.5 291,-76.5 291,-57.5 222,-57.5"/>
<text text-anchor="middle" x="256.5" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M69.91,-57.5C83.26,-61.27 99.26,-65.14 114,-67 146.53,-71.11 183.59,-70.93 211.63,-69.82"/>
<polygon fill="midnightblue" stroke="midnightblue" points="212.07,-73.31 221.9,-69.36 211.75,-66.32 212.07,-73.31"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303" target="_top" xlink:title="A utility function which check whether i and j belongs to same set or not.">
<polygon fill="white" stroke="black" points="114,-38.5 114,-57.5 186,-57.5 186,-38.5 114,-38.5"/>
<text text-anchor="middle" x="150" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::isSame</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge3" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M78.12,-48C86.33,-48 95.08,-48 103.53,-48"/>
<polygon fill="midnightblue" stroke="midnightblue" points="103.64,-51.5 113.64,-48 103.64,-44.5 103.64,-51.5"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
<polygon fill="white" stroke="black" points="120.5,-0.5 120.5,-19.5 179.5,-19.5 179.5,-0.5 120.5,-0.5"/>
<text text-anchor="middle" x="150" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge5" class="edge">
<title>Node1&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M67.51,-38.41C80.93,-33.73 97.28,-28.03 111.8,-22.97"/>
<polygon fill="midnightblue" stroke="midnightblue" points="113.21,-26.18 121.5,-19.59 110.91,-19.57 113.21,-26.18"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M240.16,-76.76C232.21,-85.57 237.66,-95 256.5,-95 268.27,-95 274.82,-91.31 276.13,-86.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="279.38,-85.09 272.84,-76.76 272.76,-87.35 279.38,-85.09"/>
</g>
<!-- Node3&#45;&gt;Node2 -->
<g id="edge4" class="edge">
<title>Node3&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M186.09,-54.38C194.36,-55.88 203.27,-57.5 211.86,-59.07"/>
<polygon fill="midnightblue" stroke="midnightblue" points="211.28,-62.52 221.74,-60.86 212.53,-55.63 211.28,-62.52"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,4 @@
<map id="dsu::getParents" name="dsu::getParents">
<area shape="rect" id="node1" title="Method to print all the parents of i, or the path from i to representative." alt="" coords="5,5,121,32"/>
<area shape="rect" id="node2" href="$d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" title=" " alt="" coords="169,5,213,32"/>
</map>

View File

@@ -0,0 +1 @@
63bfa50bd8a4707f867af6c434c208b1

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::getParents Pages: 1 -->
<svg width="164pt" height="28pt"
viewBox="0.00 0.00 164.00 28.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 24)">
<title>dsu::getParents</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-24 160,-24 160,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Method to print all the parents of i, or the path from i to representative.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 87,-19.5 87,-0.5 0,-0.5"/>
<text text-anchor="middle" x="43.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::getParents</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa" target="_top" xlink:title=" ">
<polygon fill="white" stroke="black" points="123,-0.5 123,-19.5 156,-19.5 156,-0.5 123,-0.5"/>
<text text-anchor="middle" x="139.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">ans</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M87.1,-10C95.78,-10 104.67,-10 112.56,-10"/>
<polygon fill="midnightblue" stroke="midnightblue" points="112.58,-13.5 122.58,-10 112.58,-6.5 112.58,-13.5"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,4 @@
<map id="dsu::get_min" name="dsu::get_min">
<area shape="rect" id="node1" title="A utility function that returns the min element of the set to which i belongs to." alt="" coords="5,29,104,56"/>
<area shape="rect" id="node2" href="$dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" title="Method to find the representative of the set to which i belongs to, T(n) = O(1)" alt="" coords="152,29,244,56"/>
</map>

View File

@@ -0,0 +1 @@
47fee60ab5e8f8593f22e6db15fae70d

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.49.2 (20211016.1639)
-->
<!-- Title: dsu::get_min Pages: 1 -->
<svg width="187pt" height="46pt"
viewBox="0.00 0.00 187.00 46.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 42)">
<title>dsu::get_min</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-42 183,-42 183,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="A utility function that returns the min element of the set to which i belongs to.">
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 74,-19.5 74,-0.5 0,-0.5"/>
<text text-anchor="middle" x="37" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::get_min</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c" target="_top" xlink:title="Method to find the representative of the set to which i belongs to, T(n) = O(1)">
<polygon fill="white" stroke="black" points="110,-0.5 110,-19.5 179,-19.5 179,-0.5 110,-0.5"/>
<text text-anchor="middle" x="144.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">dsu::findSet</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M74.01,-10C82.24,-10 91.08,-10 99.61,-10"/>
<polygon fill="midnightblue" stroke="midnightblue" points="99.78,-13.5 109.78,-10 99.78,-6.5 99.78,-13.5"/>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2" class="edge">
<title>Node2&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M128.16,-19.76C120.21,-28.57 125.66,-38 144.5,-38 156.27,-38 162.82,-34.31 164.13,-29.4"/>
<polygon fill="midnightblue" stroke="midnightblue" points="167.38,-28.09 160.84,-19.76 160.76,-30.35 167.38,-28.09"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB