mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-24 05:42:59 +08:00
Documentation for db149bf3b7
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<!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">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<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.4"/>
|
||||
<meta name="generator" content="Doxygen 1.9.5"/>
|
||||
<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,10 +41,10 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.4 -->
|
||||
<!-- Generated by Doxygen 1.9.5 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
@@ -84,9 +84,16 @@ $(document).ready(function(){initNavTree('d3/dae/dsu__path__compression_8cpp.htm
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
@@ -105,7 +112,7 @@ $(document).ready(function(){initNavTree('d3/dae/dsu__path__compression_8cpp.htm
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for dsu_path_compression.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/de3/dsu__path__compression_8cpp__incl.svg" width="256" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/de3/dsu__path__compression_8cpp__incl.svg" width="256" height="124"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
@@ -134,7 +141,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
<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>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -168,14 +175,14 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
</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="../../d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="603" height="443"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/dae/dsu__path__compression_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="603" height="384"><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="ae7880ce913f3058a35ff106d5be9e243" name="ae7880ce913f3058a35ff106d5be9e243"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae7880ce913f3058a35ff106d5be9e243">◆ </a></span>test1()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae7880ce913f3058a35ff106d5be9e243">◆ </a></span>test1()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -208,27 +215,26 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <span class="comment">// set 1</span></div>
|
||||
<div class="line"><span class="lineno"> 174</span> d.UnionSet(1, 2); <span class="comment">// performs union operation on 1 and 2</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> d.UnionSet(1, 4); <span class="comment">// performs union operation on 1 and 4</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = {1, 4, 3};</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 178</span> assert(d.get(4).at(i) == <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {1, 4, 3};</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 178</span> assert(d.get(4).at(i) == ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 179</span> }</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"1st test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 181</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition:</b> matrix_exponentiation.cpp:36</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="../../d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg" width="504" height="443"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/dae/dsu__path__compression_8cpp_ae7880ce913f3058a35ff106d5be9e243_cgraph.svg" width="504" height="384"><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="a45d94ead4cf4e1ff9f87c38bc99f59ae" name="a45d94ead4cf4e1ff9f87c38bc99f59ae"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a45d94ead4cf4e1ff9f87c38bc99f59ae">◆ </a></span>test2()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a45d94ead4cf4e1ff9f87c38bc99f59ae">◆ </a></span>test2()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
@@ -262,16 +268,16 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 191</span> d.UnionSet(3, 5);</div>
|
||||
<div class="line"><span class="lineno"> 192</span> d.UnionSet(5, 6);</div>
|
||||
<div class="line"><span class="lineno"> 193</span> d.UnionSet(5, 7);</div>
|
||||
<div class="line"><span class="lineno"> 194</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a> = {3, 7, 4};</div>
|
||||
<div class="line"><span class="lineno"> 195</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 196</span> assert(d.get(3).at(i) == <a class="code hl_function" href="../../d7/d35/matrix__exponentiation_8cpp.html#ad8389ed58fd0ec66df248014775ad1fa">ans</a>[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 194</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<uint64_t></a> ans = {3, 7, 4};</div>
|
||||
<div class="line"><span class="lineno"> 195</span> <span class="keywordflow">for</span> (uint64_t i = 0; i < ans.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 196</span> assert(d.get(3).at(i) == ans[i]); <span class="comment">// makes sure algorithm works fine</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span> }</div>
|
||||
<div class="line"><span class="lineno"> 198</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"2nd test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 199</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="../../d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg" width="504" height="443"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/dae/dsu__path__compression_8cpp_a45d94ead4cf4e1ff9f87c38bc99f59ae_cgraph.svg" width="504" height="384"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -283,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.4 </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>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user