mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-03 18:41:59 +08:00
Documentation for 53a6c16730
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.2"/>
|
||||
<meta name="generator" content="Doxygen 1.9.3"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: graph/lowest_common_ancestor.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -30,8 +30,8 @@ MathJax.Hub.Config({
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<!-- Generated by Doxygen 1.9.3 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
@@ -174,10 +174,10 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p >Main function </p>
|
||||
<div class="fragment"><div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> {</div>
|
||||
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <a class="code hl_function" href="../../de/dde/lowest__common__ancestor_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>();</div>
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 255</span> {</div>
|
||||
<div class="line"><span class="lineno"> 256</span> <a class="code hl_function" href="../../de/dde/lowest__common__ancestor_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>();</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 258</span>}</div>
|
||||
<div class="ttc" id="alowest__common__ancestor_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="../../de/dde/lowest__common__ancestor_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdef"><b>Definition:</b> lowest_common_ancestor.cpp:234</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -215,25 +215,25 @@ Here is the call graph for this function:</div>
|
||||
/ | \
|
||||
1 6 4
|
||||
</pre><p> / | / \ \ 7 5 2 8 0 | 9</p>
|
||||
<div class="fragment"><div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> {<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span><span class="comment"> /**</span></div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span><span class="comment"> * _ 3 _</span></div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span><span class="comment"> * / | \</span></div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span><span class="comment"> * 1 6 4</span></div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span><span class="comment"> * / | / \ \</span></div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span><span class="comment"> * 7 5 2 8 0</span></div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span><span class="comment"> * |</span></div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span><span class="comment"> * 9</span></div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span><span class="comment"> */</span></div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::pair<int, int></a> > edges = {</div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> {7, 1}, {1, 5}, {1, 3}, {3, 6}, {6, 2}, {2, 9}, {6, 8}, {4, 3}, {0, 4}};</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <a class="code hl_class" href="../../d0/d58/classgraph_1_1_rooted_tree.html">graph::RootedTree</a> t(edges, 3);</div>
|
||||
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> <a class="code hl_class" href="../../d9/d23/classgraph_1_1_lowest_common_ancestor.html">graph::LowestCommonAncestor</a> lca(t);</div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> assert(lca.lowest_common_ancestor(7, 4) == 3);</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> assert(lca.lowest_common_ancestor(9, 6) == 6);</div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> assert(lca.lowest_common_ancestor(0, 0) == 0);</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> assert(lca.lowest_common_ancestor(8, 2) == 6);</div>
|
||||
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 234</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 235</span><span class="comment"> /**</span></div>
|
||||
<div class="line"><span class="lineno"> 236</span><span class="comment"> * _ 3 _</span></div>
|
||||
<div class="line"><span class="lineno"> 237</span><span class="comment"> * / | \</span></div>
|
||||
<div class="line"><span class="lineno"> 238</span><span class="comment"> * 1 6 4</span></div>
|
||||
<div class="line"><span class="lineno"> 239</span><span class="comment"> * / | / \ \</span></div>
|
||||
<div class="line"><span class="lineno"> 240</span><span class="comment"> * 7 5 2 8 0</span></div>
|
||||
<div class="line"><span class="lineno"> 241</span><span class="comment"> * |</span></div>
|
||||
<div class="line"><span class="lineno"> 242</span><span class="comment"> * 9</span></div>
|
||||
<div class="line"><span class="lineno"> 243</span><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="lineno"> 244</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::pair<int, int></a> > edges = {</div>
|
||||
<div class="line"><span class="lineno"> 245</span> {7, 1}, {1, 5}, {1, 3}, {3, 6}, {6, 2}, {2, 9}, {6, 8}, {4, 3}, {0, 4}};</div>
|
||||
<div class="line"><span class="lineno"> 246</span> <a class="code hl_class" href="../../d0/d58/classgraph_1_1_rooted_tree.html">graph::RootedTree</a> t(edges, 3);</div>
|
||||
<div class="line"><span class="lineno"> 247</span> <a class="code hl_class" href="../../d9/d23/classgraph_1_1_lowest_common_ancestor.html">graph::LowestCommonAncestor</a> lca(t);</div>
|
||||
<div class="line"><span class="lineno"> 248</span> assert(lca.lowest_common_ancestor(7, 4) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 249</span> assert(lca.lowest_common_ancestor(9, 6) == 6);</div>
|
||||
<div class="line"><span class="lineno"> 250</span> assert(lca.lowest_common_ancestor(0, 0) == 0);</div>
|
||||
<div class="line"><span class="lineno"> 251</span> assert(lca.lowest_common_ancestor(8, 2) == 6);</div>
|
||||
<div class="line"><span class="lineno"> 252</span>}</div>
|
||||
<div class="ttc" id="aclassgraph_1_1_lowest_common_ancestor_html"><div class="ttname"><a href="../../d9/d23/classgraph_1_1_lowest_common_ancestor.html">graph::LowestCommonAncestor</a></div><div class="ttdef"><b>Definition:</b> lowest_common_ancestor.cpp:145</div></div>
|
||||
<div class="ttc" id="aclassgraph_1_1_rooted_tree_html"><div class="ttname"><a href="../../d0/d58/classgraph_1_1_rooted_tree.html">graph::RootedTree</a></div><div class="ttdef"><b>Definition:</b> lowest_common_ancestor.cpp:84</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>
|
||||
@@ -252,7 +252,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_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li><li class="navelem"><a class="el" href="../../de/dde/lowest__common__ancestor_8cpp.html">lowest_common_ancestor.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.2 </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.3 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<map id="tests" name="tests">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,13,56,39"/>
|
||||
<area shape="rect" id="node2" href="$d9/d23/classgraph_1_1_lowest_common_ancestor.html#a60151e19512b48cc0b14ea121df00488" title="Query the structure to find the lowest common ancestor. Assumes that the provided numbers are valid i..." alt="" coords="104,5,313,47"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap.html#" title=" " alt="" coords="361,13,440,39"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="361,13,440,39"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
2c0917ba04abf4d2d5a288943459e543
|
||||
f04f359cd646bfe32d7bd020668d1bb4
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap.html#" xlink:title=" ">
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="267,-6 267,-25 326,-25 326,-6 267,-6"/>
|
||||
<text text-anchor="middle" x="296.5" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -2,5 +2,5 @@
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,13,56,39"/>
|
||||
<area shape="rect" id="node2" href="$de/dde/lowest__common__ancestor_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e" title=" " alt="" coords="104,13,155,39"/>
|
||||
<area shape="rect" id="node3" href="$d9/d23/classgraph_1_1_lowest_common_ancestor.html#a60151e19512b48cc0b14ea121df00488" title="Query the structure to find the lowest common ancestor. Assumes that the provided numbers are valid i..." alt="" coords="203,5,412,47"/>
|
||||
<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="460,13,539,39"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/swap#" title=" " alt="" coords="460,13,539,39"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
5ed5314781633e24099a48690e85f137
|
||||
9d7aafe30dac7a5e9804048a180cdb96
|
||||
@@ -52,7 +52,7 @@
|
||||
<!-- 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=" ">
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/swap#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="341,-6 341,-25 400,-25 400,-6 341,-6"/>
|
||||
<text text-anchor="middle" x="370.5" y="-13" font-family="Helvetica,sans-Serif" font-size="10.00">std::swap</text>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Reference in New Issue
Block a user