mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-25 14:23:03 +08:00
Documentation for 0931d530ae
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<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.5"/>
|
||||
<meta name="generator" content="Doxygen 1.9.6"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: data_structures/dsu_path_compression.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.5 -->
|
||||
<!-- Generated by Doxygen 1.9.6 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -125,18 +125,18 @@ Classes</h2></td></tr>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:ae7880ce913f3058a35ff106d5be9e243"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a> ()</td></tr>
|
||||
<tr class="memdesc:ae7880ce913f3058a35ff106d5be9e243"><td class="mdescLeft"> </td><td class="mdescRight">Self-test implementations, 1st test. <a href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:ae7880ce913f3058a35ff106d5be9e243"><td class="mdescLeft"> </td><td class="mdescRight">Self-test implementations, 1st test. <br /></td></tr>
|
||||
<tr class="separator:ae7880ce913f3058a35ff106d5be9e243"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a45d94ead4cf4e1ff9f87c38bc99f59ae"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a> ()</td></tr>
|
||||
<tr class="memdesc:a45d94ead4cf4e1ff9f87c38bc99f59ae"><td class="mdescLeft"> </td><td class="mdescRight">Self-implementations, 2nd test. <a href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:a45d94ead4cf4e1ff9f87c38bc99f59ae"><td class="mdescLeft"> </td><td class="mdescRight">Self-implementations, 2nd test. <br /></td></tr>
|
||||
<tr class="separator:a45d94ead4cf4e1ff9f87c38bc99f59ae"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <a href="../../d3/dae/dsu__path__compression_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <br /></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p ><a href="https://en.wikipedia.org/wiki/Disjoint-set-data_structure" target="_blank">DSU (Disjoint sets)</a> </p>
|
||||
<p >It is a very powerful data structure that keeps track of different clusters(sets) of elements, these sets are disjoint(doesnot have a common
|
||||
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Disjoint-set-data_structure" target="_blank">DSU (Disjoint sets)</a> </p>
|
||||
<p>It is a very powerful data structure that keeps track of different clusters(sets) of elements, these sets are disjoint(doesnot have a common
|
||||
element). Disjoint sets uses cases : for finding connected components in a graph, used in Kruskal's algorithm for finding <a class="el" href="../../d4/d12/namespace_minimum.html" title="Implementation of Minimum Edit Distance algorithm.">Minimum</a> Spanning tree. Operations that can be performed: 1) UnionSet(i,j): add(element i and j to the set) 2) findSet(i): returns the representative of the set to which i belogngs to. 3) get_max(i),get_min(i) : returns the maximum and minimum Below is the class-based approach which uses the heuristic of path compression. Using path compression in findSet(i),we are able to get to the representative of i in O(1) time. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AayushVyasKIIT" target="_blank">AayushVyasKIIT</a> </dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../df/d28/dsu__union__rank_8cpp.html" title="DSU (Disjoint sets)">dsu_union_rank.cpp</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
@@ -158,8 +158,8 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<p >< number of items</p>
|
||||
<p >< object of class disjoint sets</p>
|
||||
<p>< number of items</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 205</span> {</div>
|
||||
<div class="line"><span class="lineno"> 206</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
<div class="line"><span class="lineno"> 207</span> <a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> d(n + 1); <span class="comment">///< object of class disjoint sets</span></div>
|
||||
@@ -206,8 +206,8 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Self-test implementations, 1st test. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<p >< number of items</p>
|
||||
<p >< object of class disjoint sets</p>
|
||||
<p>< number of items</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 169</span> {</div>
|
||||
<div class="line"><span class="lineno"> 170</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
<div class="line"><span class="lineno"> 171</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
@@ -258,8 +258,8 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Self-implementations, 2nd test. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<p >< number of items</p>
|
||||
<p >< object of class disjoint sets</p>
|
||||
<p>< number of items</p>
|
||||
<p>< object of class disjoint sets</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 186</span> {</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
<div class="line"><span class="lineno"> 188</span> uint64_t n = 10; <span class="comment">///< number of items</span></div>
|
||||
@@ -289,7 +289,7 @@ Here is the call graph for this function:</div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html">dsu_path_compression.cpp</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.5 </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.6 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user