mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-16 11:32:44 +08:00
Documentation for 8b1eab204b
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!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" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: CycleCheck Class Reference</title>
|
||||
<title>TheAlgorithms/C++: CycleCheck Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<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>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<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 type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</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>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -130,7 +147,7 @@ Private Types</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-static-methods" name="pri-static-methods"></a>
|
||||
Static Private Member Functions</h2></td></tr>
|
||||
<tr class="memitem:a2f4485c08b45e7a21a2e86f9c3f01d8b" id="r_a2f4485c08b45e7a21a2e86f9c3f01d8b"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">isCyclicDFSHelper</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">AdjList</a> const &adjList, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< nodeStates > *state, unsigned int <a class="el" href="../../d5/da1/structnode.html">node</a>)</td></tr>
|
||||
<tr class="memitem:a2f4485c08b45e7a21a2e86f9c3f01d8b" id="r_a2f4485c08b45e7a21a2e86f9c3f01d8b"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">isCyclicDFSHelper</a> (AdjList const &adjList, std::vector< nodeStates > *state, unsigned int <a class="el" href="../../d5/da1/structnode.html">node</a>)</td></tr>
|
||||
<tr class="separator:a2f4485c08b45e7a21a2e86f9c3f01d8b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
@@ -140,6 +157,8 @@ Static Private Member Functions</h2></td></tr>
|
||||
<li>isCyclicDFS uses DFS traversal method to check for cycle in a graph.</li>
|
||||
<li>isCyclidBFS used BFS traversal method to check for cycle in a graph. </li>
|
||||
</ul>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html#l00159">159</a> of file <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html">cycle_check_directed_graph.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
||||
<a id="ae68a1f08ee8c0b6323ab0f281862eadf" name="ae68a1f08ee8c0b6323ab0f281862eadf"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae68a1f08ee8c0b6323ab0f281862eadf">◆ </a></span>nodeStates</h2>
|
||||
@@ -160,6 +179,8 @@ Static Private Member Functions</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html#l00161">161</a> of file <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html">cycle_check_directed_graph.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 161</span>: uint8_t { not_visited = 0, in_stack, visited };</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -196,11 +217,13 @@ Static Private Member Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if a cycle is detected, else false. </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html#l00250">250</a> of file <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html">cycle_check_directed_graph.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 250</span> {</div>
|
||||
<div class="line"><span class="lineno"> 251</span> <span class="keyword">auto</span> graphAjdList = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getAdjList();</div>
|
||||
<div class="line"><span class="lineno"> 252</span> <span class="keyword">auto</span> vertices = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getVertices();</div>
|
||||
<div class="line"><span class="lineno"> 253</span> </div>
|
||||
<div class="line"><span class="lineno"> 254</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<unsigned int></a> indegree(vertices, 0);</div>
|
||||
<div class="line"><span class="lineno"> 254</span> std::vector<unsigned int> indegree(vertices, 0);</div>
|
||||
<div class="line"><span class="lineno"> 255</span> <span class="comment">// Calculate the indegree i.e. the number of incident edges to the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 256</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span>& <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a> : graphAjdList) {</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <span class="keyword">auto</span> children = <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>.second;</div>
|
||||
@@ -209,22 +232,22 @@ Static Private Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 260</span> }</div>
|
||||
<div class="line"><span class="lineno"> 261</span> }</div>
|
||||
<div class="line"><span class="lineno"> 262</span> </div>
|
||||
<div class="line"><span class="lineno"> 263</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue<unsigned int></a> can_be_solved;</div>
|
||||
<div class="line"><span class="lineno"> 263</span> std::queue<unsigned int> can_be_solved;</div>
|
||||
<div class="line"><span class="lineno"> 264</span> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = 0; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> < vertices; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 265</span> <span class="comment">// If a node doesn't have any input edges, then that node will</span></div>
|
||||
<div class="line"><span class="lineno"> 266</span> <span class="comment">// definately not result in a cycle and can be visited safely.</span></div>
|
||||
<div class="line"><span class="lineno"> 267</span> <span class="keywordflow">if</span> (!indegree[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>]) {</div>
|
||||
<div class="line"><span class="lineno"> 268</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">emplace</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 268</span> can_be_solved.emplace(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 269</span> }</div>
|
||||
<div class="line"><span class="lineno"> 270</span> }</div>
|
||||
<div class="line"><span class="lineno"> 271</span> </div>
|
||||
<div class="line"><span class="lineno"> 272</span> <span class="comment">// Vertices that need to be traversed.</span></div>
|
||||
<div class="line"><span class="lineno"> 273</span> <span class="keyword">auto</span> remain = vertices;</div>
|
||||
<div class="line"><span class="lineno"> 274</span> <span class="comment">// While there are safe nodes that we can visit.</span></div>
|
||||
<div class="line"><span class="lineno"> 275</span> <span class="keywordflow">while</span> (!can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/empty.html">empty</a>()) {</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <span class="keyword">auto</span> solved = can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/front.html">front</a>();</div>
|
||||
<div class="line"><span class="lineno"> 275</span> <span class="keywordflow">while</span> (!can_be_solved.empty()) {</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <span class="keyword">auto</span> solved = can_be_solved.front();</div>
|
||||
<div class="line"><span class="lineno"> 277</span> <span class="comment">// Visit the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 278</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/pop.html">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 278</span> can_be_solved.pop();</div>
|
||||
<div class="line"><span class="lineno"> 279</span> <span class="comment">// Decrease number of nodes that need to be traversed.</span></div>
|
||||
<div class="line"><span class="lineno"> 280</span> remain--;</div>
|
||||
<div class="line"><span class="lineno"> 281</span> </div>
|
||||
@@ -236,7 +259,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 287</span> <span class="keywordflow">if</span> (--indegree[child] == 0) {</div>
|
||||
<div class="line"><span class="lineno"> 288</span> <span class="comment">// if node can be visited safely, then add that node to</span></div>
|
||||
<div class="line"><span class="lineno"> 289</span> <span class="comment">// the visit queue.</span></div>
|
||||
<div class="line"><span class="lineno"> 290</span> can_be_solved.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">emplace</a>(child);</div>
|
||||
<div class="line"><span class="lineno"> 290</span> can_be_solved.emplace(child);</div>
|
||||
<div class="line"><span class="lineno"> 291</span> }</div>
|
||||
<div class="line"><span class="lineno"> 292</span> }</div>
|
||||
<div class="line"><span class="lineno"> 293</span> }</div>
|
||||
@@ -246,21 +269,10 @@ Static Private Member Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 297</span> <span class="comment">// there is a cycle and return true, else return false.</span></div>
|
||||
<div class="line"><span class="lineno"> 298</span> <span class="keywordflow">return</span> !(remain == 0);</div>
|
||||
<div class="line"><span class="lineno"> 299</span> }</div>
|
||||
<div class="ttc" id="aemplace_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/emplace.html">std::queue::emplace</a></div><div class="ttdeci">T emplace(T... args)</div></div>
|
||||
<div class="ttc" id="aempty_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/empty.html">std::queue::empty</a></div><div class="ttdeci">T empty(T... args)</div></div>
|
||||
<div class="ttc" id="afront_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/front.html">std::queue::front</a></div><div class="ttdeci">T front(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
<div class="ttc" id="apop_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue/pop.html">std::queue::pop</a></div><div class="ttdeci">T pop(T... args)</div></div>
|
||||
<div class="ttc" id="aqueue_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/queue.html">std::queue</a></div></div>
|
||||
<div class="ttc" id="astructlist_html"><div class="ttname"><a href="../../d8/d10/structlist.html">list</a></div><div class="ttdef"><b>Definition</b> hash_search.cpp:29</div></div>
|
||||
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition</b> binary_search_tree.cpp:11</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/dbb/class_cycle_check_a399292a33edf87499daa52b51315aca5_cgraph.svg" width="372" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="astructlist_html"><div class="ttname"><a href="../../d8/d10/structlist.html">list</a></div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00029">hash_search.cpp:29</a></div></div>
|
||||
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ad9a270ffba3a68539b92272c702e3474" name="ad9a270ffba3a68539b92272c702e3474"></a>
|
||||
@@ -297,17 +309,12 @@ Here is the call graph for this function:</div>
|
||||
<p>State of the node.</p>
|
||||
<p>It is a vector of "nodeStates" which represents the state node is in. It can take only 3 values: "not_visited", "in_stack", and "visited".</p>
|
||||
<p>Initially, all nodes are in "not_visited" state.</p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html#l00213">213</a> of file <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html">cycle_check_directed_graph.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 213</span> {</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <span class="keyword">auto</span> vertices = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.getVertices();</div>
|
||||
<div class="line"><span class="lineno"> 215</span><span class="comment"></span> </div>
|
||||
<div class="line"><span class="lineno"> 216</span><span class="comment"> /** State of the node.</span></div>
|
||||
<div class="line"><span class="lineno"> 217</span><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="lineno"> 218</span><span class="comment"> * It is a vector of "nodeStates" which represents the state node is in.</span></div>
|
||||
<div class="line"><span class="lineno"> 219</span><span class="comment"> * It can take only 3 values: "not_visited", "in_stack", and "visited".</span></div>
|
||||
<div class="line"><span class="lineno"> 220</span><span class="comment"> *</span></div>
|
||||
<div class="line"><span class="lineno"> 221</span><span class="comment"> * Initially, all nodes are in "not_visited" state.</span></div>
|
||||
<div class="line"><span class="lineno"> 222</span><span class="comment"> */</span></div>
|
||||
<div class="line"><span class="lineno"> 223</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<nodeStates></a> state(vertices, not_visited);</div>
|
||||
<div class="line"><span class="lineno"> 215</span> </div>
|
||||
<div class="line"><span class="lineno"> 223</span> std::vector<nodeStates> state(vertices, not_visited);</div>
|
||||
<div class="line"><span class="lineno"> 224</span> </div>
|
||||
<div class="line"><span class="lineno"> 225</span> <span class="comment">// Start visiting each node.</span></div>
|
||||
<div class="line"><span class="lineno"> 226</span> <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = 0; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> < vertices; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>++) {</div>
|
||||
@@ -326,13 +333,8 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 239</span> <span class="comment">// the graph. Return false.</span></div>
|
||||
<div class="line"><span class="lineno"> 240</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 241</span> }</div>
|
||||
<div class="ttc" id="aclass_cycle_check_html_a2f4485c08b45e7a21a2e86f9c3f01d8b"><div class="ttname"><a href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">CycleCheck::isCyclicDFSHelper</a></div><div class="ttdeci">static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)</div><div class="ttdef"><b>Definition</b> cycle_check_directed_graph.cpp:171</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/dbb/class_cycle_check_ad9a270ffba3a68539b92272c702e3474_cgraph.svg" width="598" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="aclass_cycle_check_html_a2f4485c08b45e7a21a2e86f9c3f01d8b"><div class="ttname"><a href="#a2f4485c08b45e7a21a2e86f9c3f01d8b">CycleCheck::isCyclicDFSHelper</a></div><div class="ttdeci">static bool isCyclicDFSHelper(AdjList const &adjList, std::vector< nodeStates > *state, unsigned int node)</div><div class="ttdef"><b>Definition</b> <a href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html#l00171">cycle_check_directed_graph.cpp:171</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a2f4485c08b45e7a21a2e86f9c3f01d8b" name="a2f4485c08b45e7a21a2e86f9c3f01d8b"></a>
|
||||
@@ -347,12 +349,12 @@ Here is the call graph for this function:</div>
|
||||
<tr>
|
||||
<td class="memname">static bool CycleCheck::isCyclicDFSHelper </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/map.html">AdjList</a> const &</td> <td class="paramname"><span class="paramname"><em>adjList</em></span>, </td>
|
||||
<td class="paramtype">AdjList const &</td> <td class="paramname"><span class="paramname"><em>adjList</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< nodeStates > *</td> <td class="paramname"><span class="paramname"><em>state</em></span>, </td>
|
||||
<td class="paramtype">std::vector< nodeStates > *</td> <td class="paramname"><span class="paramname"><em>state</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
@@ -376,6 +378,8 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if graph has a cycle, else false. </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html#l00171">171</a> of file <a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html">cycle_check_directed_graph.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 173</span> {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> <span class="comment">// Add node "in_stack" state.</span></div>
|
||||
<div class="line"><span class="lineno"> 175</span> (*state)[<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>] = in_stack;</div>
|
||||
@@ -407,17 +411,12 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="comment">// Return that current node didn't result in any cycles.</span></div>
|
||||
<div class="line"><span class="lineno"> 202</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 203</span> }</div>
|
||||
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> avltree.cpp:13</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/dbb/class_cycle_check_a2f4485c08b45e7a21a2e86f9c3f01d8b_cgraph.svg" width="374" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this class was generated from the following file:<ul>
|
||||
<li>graph/<b>cycle_check_directed_graph.cpp</b></li>
|
||||
<li>graph/<a class="el" href="../../d3/dec/cycle__check__directed__graph_8cpp_source.html">cycle_check_directed_graph.cpp</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
|
||||
Reference in New Issue
Block a user