Documentation for c26eea874d
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: scripts/file_linter.py Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -169,7 +169,7 @@ $(function(){initNavTree('d6/d02/file__linter_8py_source.html','../../'); initRe
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_53e6fa9553ac22a5646d2a2b2d7b97a1.html">scripts</a></li><li class="navelem"><b>file_linter.py</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures::queue_using_array::Queue_Array Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -291,7 +291,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -318,7 +318,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -345,7 +345,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -366,7 +366,7 @@ Private Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><b>queue_using_array</b></li><li class="navelem"><a class="el" href="../../d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html">Queue_Array</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/longest_increasing_subsequence_using_binary_search.cpp Pages: 1 -->
|
||||
<svg width="326pt" height="105pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/longest_increasing_subsequence_using_binary_search.cpp Pages: 1 -->
|
||||
<svg width="326pt" height="105pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/reverse_a_linked_list.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -213,15 +213,16 @@ Algorithm</h3>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 53</span> {</div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-owning-memory)</span></div>
|
||||
<div class="line"><span class="lineno"> 56</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>* res = <span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>();</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* res = <span class="keyword">new</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>();</div>
|
||||
<div class="line"><span class="lineno"> 57</span> res->val = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->val;</div>
|
||||
<div class="line"><span class="lineno"> 58</span> res->next = <a class="code hl_function" href="#a7f80d9712cc7d77399dcacb4c2917511">copy_all_nodes</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->next);</div>
|
||||
<div class="line"><span class="lineno"> 58</span> res-><a class="code hl_variable" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">next</a> = <a class="code hl_function" href="#a7f80d9712cc7d77399dcacb4c2917511">copy_all_nodes</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->next);</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><span class="lineno"> 60</span> }</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 62</span>}</div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1_node_html"><div class="ttname"><a href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">data_structures::linked_list::Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00042">reverse_a_linked_list.cpp:42</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1_node_html_acfccd7b52c91d91300c5b317e5ec7a6e"><div class="ttname"><a href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">data_structures::linked_list::Node::next</a></div><div class="ttdeci">Node * next</div><div class="ttdoc">value of the current link</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00045">reverse_a_linked_list.cpp:45</a></div></div>
|
||||
<div class="ttc" id="areverse__a__linked__list_8cpp_html_a7f80d9712cc7d77399dcacb4c2917511"><div class="ttname"><a href="#a7f80d9712cc7d77399dcacb4c2917511">data_structures::linked_list::copy_all_nodes</a></div><div class="ttdeci">Node * copy_all_nodes(const Node *const node)</div><div class="ttdoc">creates a deep copy of a list starting at the input node</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00053">reverse_a_linked_list.cpp:53</a></div></div>
|
||||
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/dce/linkedlist__implentation__usingarray_8cpp_source.html#l00014">linkedlist_implentation_usingarray.cpp:14</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>
|
||||
@@ -273,7 +274,7 @@ Algorithm</h3>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -285,32 +286,32 @@ Algorithm</h3>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 228</span> {</div>
|
||||
<div class="line"><span class="lineno"> 229</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> L;</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 231</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(11);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(15);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 235</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(-12);</div>
|
||||
<div class="line"><span class="lineno"> 236</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(-20);</div>
|
||||
<div class="line"><span class="lineno"> 237</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(18);</div>
|
||||
<div class="line"><span class="lineno"> 238</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 11);</div>
|
||||
<div class="line"><span class="lineno"> 239</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 18);</div>
|
||||
<div class="line"><span class="lineno"> 240</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">reverseList</a>();</div>
|
||||
<div class="line"><span class="lineno"> 231</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(11);</div>
|
||||
<div class="line"><span class="lineno"> 232</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(12);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(15);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 235</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(-12);</div>
|
||||
<div class="line"><span class="lineno"> 236</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(-20);</div>
|
||||
<div class="line"><span class="lineno"> 237</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(18);</div>
|
||||
<div class="line"><span class="lineno"> 238</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 11);</div>
|
||||
<div class="line"><span class="lineno"> 239</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 18);</div>
|
||||
<div class="line"><span class="lineno"> 240</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">reverseList</a>();</div>
|
||||
<div class="line"><span class="lineno"> 241</span> <span class="comment">// Reversal Testing</span></div>
|
||||
<div class="line"><span class="lineno"> 242</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 18);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == -20);</div>
|
||||
<div class="line"><span class="lineno"> 244</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == -12);</div>
|
||||
<div class="line"><span class="lineno"> 245</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(3) == 10);</div>
|
||||
<div class="line"><span class="lineno"> 246</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(4) == 15);</div>
|
||||
<div class="line"><span class="lineno"> 247</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(5) == 12);</div>
|
||||
<div class="line"><span class="lineno"> 248</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 11);</div>
|
||||
<div class="line"><span class="lineno"> 242</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 18);</div>
|
||||
<div class="line"><span class="lineno"> 243</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == -20);</div>
|
||||
<div class="line"><span class="lineno"> 244</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == -12);</div>
|
||||
<div class="line"><span class="lineno"> 245</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(3) == 10);</div>
|
||||
<div class="line"><span class="lineno"> 246</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(4) == 15);</div>
|
||||
<div class="line"><span class="lineno"> 247</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(5) == 12);</div>
|
||||
<div class="line"><span class="lineno"> 248</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 11);</div>
|
||||
<div class="line"><span class="lineno"> 249</span> std::cout << <span class="stringliteral">"All tests have successfully passed!"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 250</span>}</div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00068">reverse_a_linked_list.cpp:68</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a2b951a3f1123b9b2f4891ec96aa76d69"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">data_structures::linked_list::list::traverse</a></div><div class="ttdeci">int32_t traverse(int32_t index) const</div><div class="ttdoc">Utility function to find the i th element of the list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00168">reverse_a_linked_list.cpp:168</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a9785d1478e59f5a90288b2928a7094d6"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">data_structures::linked_list::list::top</a></div><div class="ttdeci">int32_t top() const</div><div class="ttdoc">Utility function to find the top element of the list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00142">reverse_a_linked_list.cpp:142</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_aa69707af46eb6d410eb3a54ee58e1ed1"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">data_structures::linked_list::list::insert</a></div><div class="ttdeci">void insert(int32_t new_elem)</div><div class="ttdoc">Utility function that adds a new element at the end of the list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00099">reverse_a_linked_list.cpp:99</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ac466ec086c0835822467bd3d8f3ab90e"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">data_structures::linked_list::list::reverseList</a></div><div class="ttdeci">void reverseList()</div><div class="ttdoc">Utility function for reversing a list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00125">reverse_a_linked_list.cpp:125</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_af39bcc08641ce0c813023f364a9a9015"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">data_structures::linked_list::list::last</a></div><div class="ttdeci">std::shared_ptr< link > last</div><div class="ttdoc">last link on the list</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00084">linked_list.cpp:84</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00081">linked_list.cpp:81</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a4649fc2c5d09dc58608cd9299db9946f"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">data_structures::linked_list::list::insert</a></div><div class="ttdeci">void insert(int32_t new_elem)</div><div class="ttdoc">Utility function that adds a new element at the end of the list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00099">reverse_a_linked_list.cpp:99</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a89ad00dbd262e2527129813b53e16f81"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">data_structures::linked_list::list::top</a></div><div class="ttdeci">int32_t top() const</div><div class="ttdoc">Utility function to find the top element of the list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00142">reverse_a_linked_list.cpp:142</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a8b20ca89a0346c8d4193936481528c70"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">data_structures::linked_list::list::reverseList</a></div><div class="ttdeci">void reverseList()</div><div class="ttdoc">Utility function for reversing a list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00125">reverse_a_linked_list.cpp:125</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_aaca3be50a2a81bf3308d202a6dcee91a"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">data_structures::linked_list::list::traverse</a></div><div class="ttdeci">int32_t traverse(int32_t index) const</div><div class="ttdoc">Utility function to find the i th element of the list.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00168">reverse_a_linked_list.cpp:168</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ab87eecc80068fc5a80e98e83536885f2"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">data_structures::linked_list::list::last</a></div><div class="ttdeci">std::shared_ptr< link > last</div><div class="ttdoc">last link on the list</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00084">linked_list.cpp:84</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -333,24 +334,24 @@ Algorithm</h3>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 274</span> {</div>
|
||||
<div class="line"><span class="lineno"> 275</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> L;</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> otherList;</div>
|
||||
<div class="line"><span class="lineno"> 277</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 278</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(20);</div>
|
||||
<div class="line"><span class="lineno"> 279</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(30);</div>
|
||||
<div class="line"><span class="lineno"> 277</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 278</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(20);</div>
|
||||
<div class="line"><span class="lineno"> 279</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(30);</div>
|
||||
<div class="line"><span class="lineno"> 280</span> otherList = L;</div>
|
||||
<div class="line"><span class="lineno"> 281</span> </div>
|
||||
<div class="line"><span class="lineno"> 282</span> otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(40);</div>
|
||||
<div class="line"><span class="lineno"> 283</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(400);</div>
|
||||
<div class="line"><span class="lineno"> 282</span> otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(40);</div>
|
||||
<div class="line"><span class="lineno"> 283</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(400);</div>
|
||||
<div class="line"><span class="lineno"> 284</span> </div>
|
||||
<div class="line"><span class="lineno"> 285</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 286</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 287</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 288</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 285</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 286</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 287</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 288</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 289</span> </div>
|
||||
<div class="line"><span class="lineno"> 290</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 291</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 290</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 291</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 292</span> </div>
|
||||
<div class="line"><span class="lineno"> 293</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 400);</div>
|
||||
<div class="line"><span class="lineno"> 294</span> assert(otherList.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 40);</div>
|
||||
<div class="line"><span class="lineno"> 293</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 400);</div>
|
||||
<div class="line"><span class="lineno"> 294</span> assert(otherList.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 40);</div>
|
||||
<div class="line"><span class="lineno"> 295</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -373,23 +374,23 @@ Algorithm</h3>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d6/d05/reverse__a__linked__list_8cpp_source.html#l00252">252</a> of file <a class="el" href="../../d6/d05/reverse__a__linked__list_8cpp_source.html">reverse_a_linked_list.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 252</span> {</div>
|
||||
<div class="line"><span class="lineno"> 253</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> L;</div>
|
||||
<div class="line"><span class="lineno"> 254</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 255</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(20);</div>
|
||||
<div class="line"><span class="lineno"> 256</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(30);</div>
|
||||
<div class="line"><span class="lineno"> 254</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(10);</div>
|
||||
<div class="line"><span class="lineno"> 255</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(20);</div>
|
||||
<div class="line"><span class="lineno"> 256</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(30);</div>
|
||||
<div class="line"><span class="lineno"> 257</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> otherList(L);</div>
|
||||
<div class="line"><span class="lineno"> 258</span> otherList.insert(40);</div>
|
||||
<div class="line"><span class="lineno"> 259</span> </div>
|
||||
<div class="line"><span class="lineno"> 260</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(400);</div>
|
||||
<div class="line"><span class="lineno"> 260</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(400);</div>
|
||||
<div class="line"><span class="lineno"> 261</span> </div>
|
||||
<div class="line"><span class="lineno"> 262</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 262</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 263</span> assert(otherList.top() == 10);</div>
|
||||
<div class="line"><span class="lineno"> 264</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 264</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 265</span> assert(otherList.traverse(1) == 20);</div>
|
||||
<div class="line"><span class="lineno"> 266</span> </div>
|
||||
<div class="line"><span class="lineno"> 267</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 267</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 268</span> assert(otherList.traverse(2) == 30);</div>
|
||||
<div class="line"><span class="lineno"> 269</span> </div>
|
||||
<div class="line"><span class="lineno"> 270</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 400);</div>
|
||||
<div class="line"><span class="lineno"> 270</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 400);</div>
|
||||
<div class="line"><span class="lineno"> 271</span> assert(otherList.last() == 40);</div>
|
||||
<div class="line"><span class="lineno"> 272</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
@@ -401,7 +402,7 @@ Algorithm</h3>
|
||||
<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="../../d6/d05/reverse__a__linked__list_8cpp.html">reverse_a_linked_list.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -2,7 +2,7 @@ var reverse__a__linked__list_8cpp =
|
||||
[
|
||||
[ "data_structures::linked_list::Node", "d4/d0e/classdata__structures_1_1linked__list_1_1_node.html", "d4/d0e/classdata__structures_1_1linked__list_1_1_node" ],
|
||||
[ "data_structures::linked_list::list", "d1/def/classdata__structures_1_1linked__list_1_1list.html", "d1/def/classdata__structures_1_1linked__list_1_1list" ],
|
||||
[ "copy_all_nodes", "d6/d05/reverse__a__linked__list_8cpp.html#a7f80d9712cc7d77399dcacb4c2917511", null ],
|
||||
[ "data_structures::linked_list::copy_all_nodes", "d6/d05/reverse__a__linked__list_8cpp.html#a7f80d9712cc7d77399dcacb4c2917511", null ],
|
||||
[ "main", "d6/d05/reverse__a__linked__list_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/d05/reverse__a__linked__list_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/reverse_a_linked_list.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,14 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="headertitle"><div class="title">reverse_a_linked_list.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d05/reverse__a__linked__list_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d05/reverse__a__linked__list_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include <new></span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d3c/namespacedata__structures.html">data_structures</a> {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d3/db0/namespacelinked__list.html">linked_list</a> {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">namespace </span>linked_list {</div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html"> 42</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a> {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">public</span>:</div>
|
||||
@@ -138,7 +139,7 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e"> 45</a></span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* <a class="code hl_variable" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">next</a>; </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span></div>
|
||||
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../d6/d05/reverse__a__linked__list_8cpp.html#a7f80d9712cc7d77399dcacb4c2917511"> 53</a></span><a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* <a class="code hl_function" href="../../d6/d05/reverse__a__linked__list_8cpp.html#a7f80d9712cc7d77399dcacb4c2917511">copy_all_nodes</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* <span class="keyword">const</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
@@ -151,41 +152,39 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)</span></div>
|
||||
<div class="foldopen" id="foldopen00068" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html"> 68</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a> {</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="keyword">class </span><a class="code hl_struct" href="../../d8/d10/structlist.html">list</a> {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* head = <span class="keyword">nullptr</span>; <span class="comment">// link before the actual first element</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500">delete_all_nodes</a>();</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">void</span> copy_all_nodes_from_list(<span class="keyword">const</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& other);</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_struct" href="../../d9/d49/structdata__structures_1_1_node.html">Node</a>* head = <span class="keyword">nullptr</span>; <span class="comment">// link before the actual first element</span></div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8">delete_all_nodes</a>();</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">void</span> copy_all_nodes_from_list(<span class="keyword">const</span> <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>& other);</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">isEmpty</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(int32_t new_elem);</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">reverseList</a>();</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a1313837c0e9ec67fd9fbd17987e2d615">display</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> int32_t <a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(int32_t index) <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">~list</a>();</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">isEmpty</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(int32_t new_elem);</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">reverseList</a>();</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#abf7c97616b873ffeebdd0eac2d19d13e">display</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> int32_t <a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(int32_t index) <span class="keyword">const</span>;</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_struct" href="../../d8/d10/structlist.html">~list</a>();</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>() = <span class="keywordflow">default</span>;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& other);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#adb04f732911fcfd30f7177b367c6af41">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& other);</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>& other);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>& <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab164909ee7eadc4ab186d850e716abdf">operator=</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>& other);</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a73c52b2243a6c9501af65756123e7149"> 93</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">list::isEmpty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> head == <span class="keyword">nullptr</span>; }</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a6d50919d34481a2b96cb74627d227c0e"> 93</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">list::isEmpty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> head == <span class="keyword">nullptr</span>; }</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span></div>
|
||||
<div class="foldopen" id="foldopen00099" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1"> 99</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">list::insert</a>(int32_t n) {</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f"> 99</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">list::insert</a>(int32_t n) {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">try</span> {</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-owning-memory)</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* new_node = <span class="keyword">new</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>();</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* temp = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> new_node->val = n;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> new_node-><a class="code hl_variable" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">next</a> = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">isEmpty</a>()) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">isEmpty</a>()) {</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> head = new_node;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> temp = head;</div>
|
||||
@@ -199,9 +198,9 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span></div>
|
||||
<div class="foldopen" id="foldopen00125" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e"> 125</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">list::reverseList</a>() {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70"> 125</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">list::reverseList</a>() {</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* curr = head;</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* prev = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* next_node = <span class="keyword">nullptr</span>;</div>
|
||||
@@ -214,18 +213,19 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> head = prev;</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span></div>
|
||||
<div class="foldopen" id="foldopen00142" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6"> 142</a></span>int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">list::top</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">isEmpty</a>()) {</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81"> 142</a></span>int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">list::top</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">isEmpty</a>()) {</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">return</span> head->val;</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">throw</span> std::logic_error(<span class="stringliteral">"List is empty"</span>);</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> }</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span>int32_t <a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">list::last</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">isEmpty</a>()) {</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span>int32_t <a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">list::last</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">isEmpty</a>()) {</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* t = head;</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">while</span> (t-><a class="code hl_variable" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">next</a> != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> t = t-><a class="code hl_variable" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">next</a>;</div>
|
||||
@@ -236,7 +236,7 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> }</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span>}</div>
|
||||
<div class="foldopen" id="foldopen00168" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69"> 168</a></span>int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">list::traverse</a>(int32_t index)<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a"> 168</a></span>int32_t <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">list::traverse</a>(int32_t index)<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_class" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">Node</a>* current = head;</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordtype">int</span> count = 0;</div>
|
||||
@@ -253,32 +253,32 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> exit(1);</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> </div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span></div>
|
||||
<div class="foldopen" id="foldopen00188" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500"> 188</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500">list::delete_all_nodes</a>() {</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8"> 188</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8">list::delete_all_nodes</a>() {</div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordflow">while</span> (head != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keyword">const</span> <span class="keyword">auto</span> tmp_node = head-><a class="code hl_variable" href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">next</a>;</div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keyword">const</span> <span class="keyword">auto</span> tmp_node = head->next;</div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keyword">delete</span> head;</div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> head = tmp_node;</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> }</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span>list::~list() { <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500">delete_all_nodes</a>(); }</div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span>list::~list() { <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8">delete_all_nodes</a>(); }</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="keywordtype">void</span> list::copy_all_nodes_from_list(<span class="keyword">const</span> <a class="code hl_struct" href="../../d8/d10/structlist.html">list</a>& other) {</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> assert(<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">isEmpty</a>());</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> assert(<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">isEmpty</a>());</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> head = copy_all_nodes(other.head);</div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span>}</div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> </div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a326ac4f721f7b74d5ed4f418a67b8d38"> 206</a></span><a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list::list</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& other) { copy_all_nodes_from_list(other); }</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> </div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span></div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac681c278055081ac11decb6060b300de"> 206</a></span><a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list::list</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>& other) { copy_all_nodes_from_list(other); }</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span></div>
|
||||
<div class="foldopen" id="foldopen00211" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#adb04f732911fcfd30f7177b367c6af41"> 211</a></span><a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#adb04f732911fcfd30f7177b367c6af41">list::operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">list</a>& other) {</div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"><a class="line" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab164909ee7eadc4ab186d850e716abdf"> 211</a></span><a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>& <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab164909ee7eadc4ab186d850e716abdf">list::operator=</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">list</a>& other) {</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordflow">if</span> (<span class="keyword">this</span> == &other) {</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> }</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500">delete_all_nodes</a>();</div>
|
||||
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8">delete_all_nodes</a>();</div>
|
||||
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
|
||||
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> copy_all_nodes_from_list(other);</div>
|
||||
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
|
||||
@@ -287,78 +287,78 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> </div>
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span>} <span class="comment">// namespace linked_list</span></div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span>} <span class="comment">// namespace data_structures</span></div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> </div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span></div>
|
||||
<div class="foldopen" id="foldopen00228" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"><a class="line" href="../../d6/d05/reverse__a__linked__list_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 228</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d05/reverse__a__linked__list_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> L;</div>
|
||||
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(11);</div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(12);</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(15);</div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(10);</div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(-12);</div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(-20);</div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(18);</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 11);</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 18);</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">reverseList</a>();</div>
|
||||
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(11);</div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(12);</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(15);</div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(10);</div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(-12);</div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(-20);</div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(18);</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 11);</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 18);</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">reverseList</a>();</div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="comment">// Reversal Testing</span></div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 18);</div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == -20);</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == -12);</div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(3) == 10);</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(4) == 15);</div>
|
||||
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(5) == 12);</div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 11);</div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 18);</div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == -20);</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == -12);</div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(3) == 10);</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(4) == 15);</div>
|
||||
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(5) == 12);</div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 11);</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> std::cout << <span class="stringliteral">"All tests have successfully passed!"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> </div>
|
||||
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span><span class="keywordtype">void</span> test_copy_constructor() {</div>
|
||||
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> L;</div>
|
||||
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(10);</div>
|
||||
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(20);</div>
|
||||
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(30);</div>
|
||||
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(10);</div>
|
||||
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(20);</div>
|
||||
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(30);</div>
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> otherList(L);</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> otherList.insert(40);</div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> </div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(400);</div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(400);</div>
|
||||
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> </div>
|
||||
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 10);</div>
|
||||
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 10);</div>
|
||||
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> assert(otherList.top() == 10);</div>
|
||||
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> assert(otherList.traverse(1) == 20);</div>
|
||||
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> </div>
|
||||
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> assert(otherList.traverse(2) == 30);</div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> </div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 400);</div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 400);</div>
|
||||
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> assert(otherList.last() == 40);</div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span>}</div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> </div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span><span class="keywordtype">void</span> test_assignment_operator() {</div>
|
||||
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> L;</div>
|
||||
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> <a class="code hl_class" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a> otherList;</div>
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(10);</div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(20);</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(30);</div>
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(10);</div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(20);</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(30);</div>
|
||||
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> otherList = L;</div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> </div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(40);</div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">insert</a>(400);</div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(40);</div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">insert</a>(400);</div>
|
||||
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> </div>
|
||||
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 10);</div>
|
||||
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">top</a>() == 10);</div>
|
||||
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 10);</div>
|
||||
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">top</a>() == 10);</div>
|
||||
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(1) == 20);</div>
|
||||
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> </div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> assert(L.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> assert(otherList.<a class="code hl_function" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">traverse</a>(2) == 30);</div>
|
||||
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> </div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 400);</div>
|
||||
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> assert(otherList.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">last</a>() == 40);</div>
|
||||
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> assert(L.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 400);</div>
|
||||
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> assert(otherList.<a class="code hl_variable" href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">last</a>() == 40);</div>
|
||||
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span>}</div>
|
||||
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> </div>
|
||||
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span></div>
|
||||
<div class="foldopen" id="foldopen00301" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"><a class="line" href="../../d6/d05/reverse__a__linked__list_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 301</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d05/reverse__a__linked__list_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <a class="code hl_function" href="../../d6/d05/reverse__a__linked__list_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -369,22 +369,22 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
</div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1_node_html"><div class="ttname"><a href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html">data_structures::linked_list::Node</a></div><div class="ttdef"><b>Definition</b> <a href="#l00042">reverse_a_linked_list.cpp:42</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1_node_html_acfccd7b52c91d91300c5b317e5ec7a6e"><div class="ttname"><a href="../../d4/d0e/classdata__structures_1_1linked__list_1_1_node.html#acfccd7b52c91d91300c5b317e5ec7a6e">data_structures::linked_list::Node::next</a></div><div class="ttdeci">Node * next</div><div class="ttdoc">value of the current link</div><div class="ttdef"><b>Definition</b> <a href="#l00045">reverse_a_linked_list.cpp:45</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></div><div class="ttdef"><b>Definition</b> <a href="#l00068">reverse_a_linked_list.cpp:68</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a1313837c0e9ec67fd9fbd17987e2d615"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a1313837c0e9ec67fd9fbd17987e2d615">data_structures::linked_list::list::display</a></div><div class="ttdeci">void display()</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00181">linked_list.cpp:181</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a2b951a3f1123b9b2f4891ec96aa76d69"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a2b951a3f1123b9b2f4891ec96aa76d69">data_structures::linked_list::list::traverse</a></div><div class="ttdeci">int32_t traverse(int32_t index) const</div><div class="ttdoc">Utility function to find the i th element of the list.</div><div class="ttdef"><b>Definition</b> <a href="#l00168">reverse_a_linked_list.cpp:168</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a454ab4918f579869dfed4bb420a3f897"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a454ab4918f579869dfed4bb420a3f897">data_structures::linked_list::list::isEmpty</a></div><div class="ttdeci">bool isEmpty()</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00111">linked_list.cpp:111</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html">data_structures::linked_list::list</a></div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00081">linked_list.cpp:81</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a4649fc2c5d09dc58608cd9299db9946f"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a4649fc2c5d09dc58608cd9299db9946f">data_structures::linked_list::list::insert</a></div><div class="ttdeci">void insert(int32_t new_elem)</div><div class="ttdoc">Utility function that adds a new element at the end of the list.</div><div class="ttdef"><b>Definition</b> <a href="#l00099">reverse_a_linked_list.cpp:99</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a50e209b55b83622254177050945e7826"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a50e209b55b83622254177050945e7826">data_structures::linked_list::list::list</a></div><div class="ttdeci">list()</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00089">linked_list.cpp:89</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a9785d1478e59f5a90288b2928a7094d6"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a9785d1478e59f5a90288b2928a7094d6">data_structures::linked_list::list::top</a></div><div class="ttdeci">int32_t top() const</div><div class="ttdoc">Utility function to find the top element of the list.</div><div class="ttdef"><b>Definition</b> <a href="#l00142">reverse_a_linked_list.cpp:142</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_aa69707af46eb6d410eb3a54ee58e1ed1"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aa69707af46eb6d410eb3a54ee58e1ed1">data_structures::linked_list::list::insert</a></div><div class="ttdeci">void insert(int32_t new_elem)</div><div class="ttdoc">Utility function that adds a new element at the end of the list.</div><div class="ttdef"><b>Definition</b> <a href="#l00099">reverse_a_linked_list.cpp:99</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ac466ec086c0835822467bd3d8f3ab90e"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac466ec086c0835822467bd3d8f3ab90e">data_structures::linked_list::list::reverseList</a></div><div class="ttdeci">void reverseList()</div><div class="ttdoc">Utility function for reversing a list.</div><div class="ttdef"><b>Definition</b> <a href="#l00125">reverse_a_linked_list.cpp:125</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ac614ed8f1953f5486fab1cd6d7aa0500"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ac614ed8f1953f5486fab1cd6d7aa0500">data_structures::linked_list::list::delete_all_nodes</a></div><div class="ttdeci">void delete_all_nodes()</div><div class="ttdoc">calls delete operator on every node in the represented list</div><div class="ttdef"><b>Definition</b> <a href="#l00188">reverse_a_linked_list.cpp:188</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_adb04f732911fcfd30f7177b367c6af41"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#adb04f732911fcfd30f7177b367c6af41">data_structures::linked_list::list::operator=</a></div><div class="ttdeci">list & operator=(const list &other)</div><div class="ttdoc">assignment operator creating a deep copy of every node of the input</div><div class="ttdef"><b>Definition</b> <a href="#l00211">reverse_a_linked_list.cpp:211</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_af39bcc08641ce0c813023f364a9a9015"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#af39bcc08641ce0c813023f364a9a9015">data_structures::linked_list::list::last</a></div><div class="ttdeci">std::shared_ptr< link > last</div><div class="ttdoc">last link on the list</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00084">linked_list.cpp:84</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a540989875252b0d41d297d67efa032a8"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a540989875252b0d41d297d67efa032a8">data_structures::linked_list::list::delete_all_nodes</a></div><div class="ttdeci">void delete_all_nodes()</div><div class="ttdoc">calls delete operator on every node in the represented list</div><div class="ttdef"><b>Definition</b> <a href="#l00188">reverse_a_linked_list.cpp:188</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a89ad00dbd262e2527129813b53e16f81"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a89ad00dbd262e2527129813b53e16f81">data_structures::linked_list::list::top</a></div><div class="ttdeci">int32_t top() const</div><div class="ttdoc">Utility function to find the top element of the list.</div><div class="ttdef"><b>Definition</b> <a href="#l00142">reverse_a_linked_list.cpp:142</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_a8b20ca89a0346c8d4193936481528c70"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#a8b20ca89a0346c8d4193936481528c70">data_structures::linked_list::list::reverseList</a></div><div class="ttdeci">void reverseList()</div><div class="ttdoc">Utility function for reversing a list.</div><div class="ttdef"><b>Definition</b> <a href="#l00125">reverse_a_linked_list.cpp:125</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_aaca3be50a2a81bf3308d202a6dcee91a"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#aaca3be50a2a81bf3308d202a6dcee91a">data_structures::linked_list::list::traverse</a></div><div class="ttdeci">int32_t traverse(int32_t index) const</div><div class="ttdoc">Utility function to find the i th element of the list.</div><div class="ttdef"><b>Definition</b> <a href="#l00168">reverse_a_linked_list.cpp:168</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ab164909ee7eadc4ab186d850e716abdf"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab164909ee7eadc4ab186d850e716abdf">data_structures::linked_list::list::operator=</a></div><div class="ttdeci">list & operator=(const list &other)</div><div class="ttdoc">assignment operator creating a deep copy of every node of the input</div><div class="ttdef"><b>Definition</b> <a href="#l00211">reverse_a_linked_list.cpp:211</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ab87eecc80068fc5a80e98e83536885f2"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ab87eecc80068fc5a80e98e83536885f2">data_structures::linked_list::list::last</a></div><div class="ttdeci">std::shared_ptr< link > last</div><div class="ttdoc">last link on the list</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00084">linked_list.cpp:84</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_abf7c97616b873ffeebdd0eac2d19d13e"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#abf7c97616b873ffeebdd0eac2d19d13e">data_structures::linked_list::list::display</a></div><div class="ttdeci">void display()</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00181">linked_list.cpp:181</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1linked__list_1_1list_html_ae8424a4fce3d483f7c85d6f6a5c79a1a"><div class="ttname"><a href="../../d1/def/classdata__structures_1_1linked__list_1_1list.html#ae8424a4fce3d483f7c85d6f6a5c79a1a">data_structures::linked_list::list::isEmpty</a></div><div class="ttdeci">bool isEmpty()</div><div class="ttdef"><b>Definition</b> <a href="../../da/dc3/linked__list_8cpp_source.html#l00111">linked_list.cpp:111</a></div></div>
|
||||
<div class="ttc" id="anamespacedata__structures_html"><div class="ttname"><a href="../../d5/d3c/namespacedata__structures.html">data_structures</a></div><div class="ttdoc">for IO operations</div></div>
|
||||
<div class="ttc" id="anamespacelinked__list_html"><div class="ttname"><a href="../../d3/db0/namespacelinked__list.html">linked_list</a></div><div class="ttdoc">Functions for singly linked list algorithm.</div></div>
|
||||
<div class="ttc" id="areverse__a__linked__list_8cpp_html_a7f80d9712cc7d77399dcacb4c2917511"><div class="ttname"><a href="../../d6/d05/reverse__a__linked__list_8cpp.html#a7f80d9712cc7d77399dcacb4c2917511">data_structures::linked_list::copy_all_nodes</a></div><div class="ttdeci">Node * copy_all_nodes(const Node *const node)</div><div class="ttdoc">creates a deep copy of a list starting at the input node</div><div class="ttdef"><b>Definition</b> <a href="#l00053">reverse_a_linked_list.cpp:53</a></div></div>
|
||||
<div class="ttc" id="areverse__a__linked__list_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d6/d05/reverse__a__linked__list_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00228">reverse_a_linked_list.cpp:228</a></div></div>
|
||||
<div class="ttc" id="areverse__a__linked__list_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d6/d05/reverse__a__linked__list_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00301">reverse_a_linked_list.cpp:301</a></div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1_node_html"><div class="ttname"><a href="../../d9/d49/structdata__structures_1_1_node.html">data_structures::Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d0/d5a/skip__list_8cpp_source.html#l00033">skip_list.cpp:33</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> <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><!-- contents -->
|
||||
@@ -393,7 +393,7 @@ $(function(){initNavTree('d6/d05/reverse__a__linked__list_8cpp_source.html','../
|
||||
<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="../../d6/d05/reverse__a__linked__list_8cpp.html">reverse_a_linked_list.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -143,7 +143,7 @@ $(function(){initNavTree('d6/d0c/namespacehashing.html','../../'); initResizable
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d0c/namespacehashing.html">hashing</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/cut_rod.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -290,7 +290,7 @@ template<size_t T> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -343,7 +343,7 @@ template<size_t T> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d6/d10/cut__rod_8cpp.html">cut_rod.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var cut__rod_8cpp =
|
||||
[
|
||||
[ "main", "d6/d10/cut__rod_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "maxProfitByCuttingRod", "d6/d10/cut__rod_8cpp.html#a1cc523a30c18c63eac58220c3c494cfa", null ],
|
||||
[ "dynamic_programming::cut_rod::maxProfitByCuttingRod", "d6/d10/cut__rod_8cpp.html#a1cc523a30c18c63eac58220c3c494cfa", null ],
|
||||
[ "test", "d6/d10/cut__rod_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/cut_rod.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d6/d10/cut__rod_8cpp_source.html','../../'); initResiz
|
||||
<div class="headertitle"><div class="title">cut_rod.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d10/cut__rod_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d10/cut__rod_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <array></span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <climits></span></div>
|
||||
@@ -157,14 +158,14 @@ $(function(){initNavTree('d6/d10/cut__rod_8cpp_source.html','../../'); initResiz
|
||||
</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>} <span class="comment">// namespace cut_rod</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>} <span class="comment">// namespace dynamic_programming</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span></div>
|
||||
<div class="foldopen" id="foldopen00072" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../d6/d10/cut__rod_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 72</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d10/cut__rod_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">const</span> int16_t n1 = 8; <span class="comment">// size of rod</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> std::array<int32_t, n1> price1 = {1, 2, 4, 6, 8, 45, 21, 9}; <span class="comment">// price array</span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">const</span> int64_t max_profit1 =</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> dynamic_programming::cut_rod::maxProfitByCuttingRod(price1, n1);</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_function" href="../../d6/d10/cut__rod_8cpp.html#a1cc523a30c18c63eac58220c3c494cfa">dynamic_programming::cut_rod::maxProfitByCuttingRod</a>(price1, n1);</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">const</span> int64_t expected_max_profit1 = 47;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> assert(max_profit1 == expected_max_profit1);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::cout << <span class="stringliteral">"Maximum profit with "</span> << n1 << <span class="stringliteral">" inch road is "</span> << max_profit1</div>
|
||||
@@ -178,7 +179,7 @@ $(function(){initNavTree('d6/d10/cut__rod_8cpp_source.html','../../'); initResiz
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50};</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keyword">const</span> int64_t max_profit2 =</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> dynamic_programming::cut_rod::maxProfitByCuttingRod(price2, n2);</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_function" href="../../d6/d10/cut__rod_8cpp.html#a1cc523a30c18c63eac58220c3c494cfa">dynamic_programming::cut_rod::maxProfitByCuttingRod</a>(price2, n2);</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keyword">const</span> int32_t expected_max_profit2 = 90;</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> assert(max_profit2 == expected_max_profit2);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"Maximum profit with "</span> << n2 << <span class="stringliteral">" inch road is "</span> << max_profit2</div>
|
||||
@@ -187,14 +188,14 @@ $(function(){initNavTree('d6/d10/cut__rod_8cpp_source.html','../../'); initResiz
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keyword">const</span> int16_t n3 = 5; <span class="comment">// size of rod</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> std::array<int32_t, n3> price3 = {2, 9, 17, 23, 45}; <span class="comment">// price array</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keyword">const</span> int64_t max_profit3 =</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> dynamic_programming::cut_rod::maxProfitByCuttingRod(price3, n3);</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_function" href="../../d6/d10/cut__rod_8cpp.html#a1cc523a30c18c63eac58220c3c494cfa">dynamic_programming::cut_rod::maxProfitByCuttingRod</a>(price3, n3);</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keyword">const</span> int64_t expected_max_profit3 = 45;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> assert(max_profit3 == expected_max_profit3);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::cout << <span class="stringliteral">"Maximum profit with "</span> << n3 << <span class="stringliteral">" inch road is "</span> << max_profit3</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span></div>
|
||||
<div class="foldopen" id="foldopen00111" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="../../d6/d10/cut__rod_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 111</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d10/cut__rod_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// Testing</span></div>
|
||||
@@ -213,7 +214,7 @@ $(function(){initNavTree('d6/d10/cut__rod_8cpp_source.html','../../'); initResiz
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d6/d10/cut__rod_8cpp.html">cut_rod.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/dnf_sort.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -154,7 +154,7 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a621767fe711db64fe57a2ac4987b11f0" id="r_a621767fe711db64fe57a2ac4987b11f0"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a621767fe711db64fe57a2ac4987b11f0" id="r_a621767fe711db64fe57a2ac4987b11f0"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a621767fe711db64fe57a2ac4987b11f0"><td class="memTemplItemLeft" align="right" valign="top">std::vector< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a621767fe711db64fe57a2ac4987b11f0">sorting::dnf_sort::dnfSort</a> (const std::vector< T > &in_arr)</td></tr>
|
||||
<tr class="memdesc:a621767fe711db64fe57a2ac4987b11f0"><td class="mdescLeft"> </td><td class="mdescRight">The main function implements DNF sort. <br /></td></tr>
|
||||
<tr class="separator:a621767fe711db64fe57a2ac4987b11f0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -177,7 +177,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">std::vector< T > sorting::dnf_sort::dnfSort </td>
|
||||
@@ -281,7 +281,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -330,7 +330,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d6/d1a/dnf__sort_8cpp.html">dnf_sort.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var dnf__sort_8cpp =
|
||||
[
|
||||
[ "dnfSort", "d6/d1a/dnf__sort_8cpp.html#a621767fe711db64fe57a2ac4987b11f0", null ],
|
||||
[ "sorting::dnf_sort::dnfSort", "d6/d1a/dnf__sort_8cpp.html#a621767fe711db64fe57a2ac4987b11f0", null ],
|
||||
[ "main", "d6/d1a/dnf__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/d1a/dnf__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/dnf_sort.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,14 @@ $(function(){initNavTree('d6/d1a/dnf__sort_8cpp_source.html','../../'); initResi
|
||||
<div class="headertitle"><div class="title">dnf_sort.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d1a/dnf__sort_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d1a/dnf__sort_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d91/namespacesorting.html">sorting</a> {</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/d75/namespacednf__sort.html">dnf_sort</a> {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
@@ -166,40 +167,40 @@ $(function(){initNavTree('d6/d1a/dnf__sort_8cpp_source.html','../../'); initResi
|
||||
</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>} <span class="comment">// namespace dnf_sort</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>} <span class="comment">// namespace sorting</span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span></div>
|
||||
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d6/d1a/dnf__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 74</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// [1, 0, 2, 1] return [0, 1, 1, 2]</span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> std::vector<uint64_t> array1 = {0, 1, 1, 2};</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::cout << <span class="stringliteral">"Test 1... "</span>;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<uint64_t> arr1 = sorting::dnf_sort::dnfSort(array1);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<uint64_t> arr1 = <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#a621767fe711db64fe57a2ac4987b11f0">sorting::dnf_sort::dnfSort</a>(array1);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> assert(std::is_sorted(std::begin(arr1), std::end(arr1)));</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// [1, 0, 0, 1, 1, 0, 2, 1] return [0, 0, 0, 1, 1, 1, 1, 2]</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::vector<uint64_t> array2 = {1, 0, 0, 1, 1, 0, 2, 1};</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::cout << <span class="stringliteral">"Test 2... "</span>;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::vector<uint64_t> arr2 = sorting::dnf_sort::dnfSort(array2);</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::vector<uint64_t> arr2 = <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#a621767fe711db64fe57a2ac4987b11f0">sorting::dnf_sort::dnfSort</a>(array2);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> assert(std::is_sorted(std::begin(arr2), std::end(arr2)));</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// [1, 1, 0, 0, 1, 2, 2, 0, 2, 1] return [0, 0, 0, 1, 1, 1, 1, 2, 2, 2]</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::vector<uint64_t> array3 = {1, 1, 0, 0, 1, 2, 2, 0, 2, 1};</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::cout << <span class="stringliteral">"Test 3... "</span>;</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::vector<uint64_t> arr3 = sorting::dnf_sort::dnfSort(array3);</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::vector<uint64_t> arr3 = <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#a621767fe711db64fe57a2ac4987b11f0">sorting::dnf_sort::dnfSort</a>(array3);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> assert(std::is_sorted(std::begin(arr3), std::end(arr3)));</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// 4th test</span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// [2, 2, 2, 0, 0, 1, 1] return [0, 0, 1, 1, 2, 2, 2]</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> std::vector<uint64_t> array4 = {2, 2, 2, 0, 0, 1, 1};</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> std::cout << <span class="stringliteral">"Test 4... "</span>;</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> std::vector<uint64_t> arr4 = sorting::dnf_sort::dnfSort(array4);</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> std::vector<uint64_t> arr4 = <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#a621767fe711db64fe57a2ac4987b11f0">sorting::dnf_sort::dnfSort</a>(array4);</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> assert(std::is_sorted(std::begin(arr4), std::end(arr4)));</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span></div>
|
||||
<div class="foldopen" id="foldopen00109" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../d6/d1a/dnf__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 109</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <a class="code hl_function" href="../../d6/d1a/dnf__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the test</span></div>
|
||||
@@ -217,7 +218,7 @@ $(function(){initNavTree('d6/d1a/dnf__sort_8cpp_source.html','../../'); initResi
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d6/d1a/dnf__sort_8cpp.html">dnf_sort.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/bubble_sort.cpp Pages: 1 -->
|
||||
<svg width="378pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/bubble_sort.cpp Pages: 1 -->
|
||||
<svg width="378pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -146,7 +146,7 @@ $(function(){initNavTree('da/d5a/class_complex.html','../../'); initResizable(tr
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/lu_decomposition.h Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/lu_decomposition.h Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::reverse_binary_tree::BinaryTree Pages: 1 -->
|
||||
<svg width="197pt" height="116pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::reverse_binary_tree::BinaryTree Pages: 1 -->
|
||||
<svg width="197pt" height="116pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers::HillCipher Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -152,19 +152,19 @@ Static Public Member Functions</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:a629be41c1ab78850963e4ce14e1d11d9" id="r_a629be41c1ab78850963e4ce14e1d11d9"><td class="memTemplParams" colspan="2">template<typename T1 , typename T2 > </td></tr>
|
||||
<tr class="memitem:a629be41c1ab78850963e4ce14e1d11d9" id="r_a629be41c1ab78850963e4ce14e1d11d9"><td class="memTemplParams" colspan="2">template<typename T1, typename T2> </td></tr>
|
||||
<tr class="memitem:a629be41c1ab78850963e4ce14e1d11d9"><td class="memTemplItemLeft" align="right" valign="top">static const T2 </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a629be41c1ab78850963e4ce14e1d11d9">rand_range</a> (T1 a, T1 b)</td></tr>
|
||||
<tr class="memdesc:a629be41c1ab78850963e4ce14e1d11d9"><td class="mdescLeft"> </td><td class="mdescRight">Function to generate a random integer in a given interval. <br /></td></tr>
|
||||
<tr class="separator:a629be41c1ab78850963e4ce14e1d11d9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a716d0313141499d16f57c0c107f04395" id="r_a716d0313141499d16f57c0c107f04395"><td class="memTemplParams" colspan="2">template<typename T1 , typename T2 > </td></tr>
|
||||
<tr class="memitem:a716d0313141499d16f57c0c107f04395" id="r_a716d0313141499d16f57c0c107f04395"><td class="memTemplParams" colspan="2">template<typename T1, typename T2> </td></tr>
|
||||
<tr class="memitem:a716d0313141499d16f57c0c107f04395"><td class="memTemplItemLeft" align="right" valign="top">static double </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a716d0313141499d16f57c0c107f04395">rand_range</a> (<a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>< T2 > *M, T1 a, T1 b)</td></tr>
|
||||
<tr class="memdesc:a716d0313141499d16f57c0c107f04395"><td class="mdescLeft"> </td><td class="mdescRight">Function overload to fill a matrix with random integers in a given interval. <br /></td></tr>
|
||||
<tr class="separator:a716d0313141499d16f57c0c107f04395"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a7760f3665651a0a37937c79c62f219c0" id="r_a7760f3665651a0a37937c79c62f219c0"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a7760f3665651a0a37937c79c62f219c0" id="r_a7760f3665651a0a37937c79c62f219c0"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a7760f3665651a0a37937c79c62f219c0"><td class="memTemplItemLeft" align="right" valign="top">static const T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a7760f3665651a0a37937c79c62f219c0">gcd</a> (T a, T b)</td></tr>
|
||||
<tr class="memdesc:a7760f3665651a0a37937c79c62f219c0"><td class="mdescLeft"> </td><td class="mdescRight">Compute <a href="https://en.wikipedia.org/wiki/Greatest_common_divisor" target="_blank">GCD</a> of two integers using Euler's algorithm. <br /></td></tr>
|
||||
<tr class="separator:a7760f3665651a0a37937c79c62f219c0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ad36cbcc7a458b3f3a2af0c4aa1126590" id="r_ad36cbcc7a458b3f3a2af0c4aa1126590"><td class="memItemLeft" align="right" valign="top">static const std::valarray< uint8_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad36cbcc7a458b3f3a2af0c4aa1126590">mat_mul</a> (const std::valarray< uint8_t > &vector, const <a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>< int > &key)</td></tr>
|
||||
<tr class="memitem:ad36cbcc7a458b3f3a2af0c4aa1126590" id="r_ad36cbcc7a458b3f3a2af0c4aa1126590"><td class="memItemLeft" align="right" valign="top">static const std::valarray< uint8_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad36cbcc7a458b3f3a2af0c4aa1126590">mat_mul</a> (const std::valarray< uint8_t > &<a class="el" href="../../d7/dfc/classvector.html">vector</a>, const <a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>< int > &key)</td></tr>
|
||||
<tr class="memdesc:ad36cbcc7a458b3f3a2af0c4aa1126590"><td class="mdescLeft"> </td><td class="mdescRight">helper function to perform vector multiplication with encryption or decryption matrix <br /></td></tr>
|
||||
<tr class="separator:ad36cbcc7a458b3f3a2af0c4aa1126590"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a12f727cca9e21f9539cd74b6603adf0c" id="r_a12f727cca9e21f9539cd74b6603adf0c"><td class="memItemLeft" align="right" valign="top">static char </td><td class="memItemRight" valign="bottom"><a class="el" href="#a12f727cca9e21f9539cd74b6603adf0c">get_idx_char</a> (const uint8_t idx)</td></tr>
|
||||
@@ -176,7 +176,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
<tr class="memitem:ad667fa0860977f6d6d443fa1dbcd80aa" id="r_ad667fa0860977f6d6d443fa1dbcd80aa"><td class="memItemLeft" align="right" valign="top">static const std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad667fa0860977f6d6d443fa1dbcd80aa">codec</a> (const std::string &text, const <a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>< int > &key)</td></tr>
|
||||
<tr class="memdesc:ad667fa0860977f6d6d443fa1dbcd80aa"><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to perform block cipher operations. The operations are identical for both encryption and decryption. <br /></td></tr>
|
||||
<tr class="separator:ad667fa0860977f6d6d443fa1dbcd80aa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a2eb58750b978a93ac5e6eb29e3e570b7" id="r_a2eb58750b978a93ac5e6eb29e3e570b7"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a2eb58750b978a93ac5e6eb29e3e570b7" id="r_a2eb58750b978a93ac5e6eb29e3e570b7"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a2eb58750b978a93ac5e6eb29e3e570b7"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>< double > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a2eb58750b978a93ac5e6eb29e3e570b7">get_inverse</a> (<a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>< T > const &A)</td></tr>
|
||||
<tr class="separator:a2eb58750b978a93ac5e6eb29e3e570b7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a63e7b8e92dff8b9260d6d21c31ecebd0" id="r_a63e7b8e92dff8b9260d6d21c31ecebd0"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="#a63e7b8e92dff8b9260d6d21c31ecebd0">modulo</a> (int a, int b)</td></tr>
|
||||
@@ -209,7 +209,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -285,7 +285,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -330,7 +330,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -358,7 +358,7 @@ Static Private Member Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -376,7 +376,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -425,7 +425,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -514,7 +514,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -560,7 +560,7 @@ template<typename T > </div>
|
||||
<div class="line"><span class="lineno"> 363</span> <span class="keywordflow">return</span> encrypt_key;</div>
|
||||
<div class="line"><span class="lineno"> 364</span> }</div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a629be41c1ab78850963e4ce14e1d11d9"><div class="ttname"><a href="#a629be41c1ab78850963e4ce14e1d11d9">ciphers::HillCipher::rand_range</a></div><div class="ttdeci">static const T2 rand_range(T1 a, T1 b)</div><div class="ttdoc">Function to generate a random integer in a given interval.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/db9/hill__cipher_8cpp_source.html#l00093">hill_cipher.cpp:93</a></div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a7760f3665651a0a37937c79c62f219c0"><div class="ttname"><a href="#a7760f3665651a0a37937c79c62f219c0">ciphers::HillCipher::gcd</a></div><div class="ttdeci">static const T gcd(T a, T b)</div><div class="ttdoc">Compute GCD of two integers using Euler's algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/db9/hill__cipher_8cpp_source.html#l00139">hill_cipher.cpp:139</a></div></div>
|
||||
<div class="ttc" id="aclassciphers_1_1_hill_cipher_html_a7760f3665651a0a37937c79c62f219c0"><div class="ttname"><a href="#a7760f3665651a0a37937c79c62f219c0">ciphers::HillCipher::gcd</a></div><div class="ttdeci">static const T gcd(T a, T b)</div><div class="ttdoc">Compute GCD of two integers using Euler's algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/db9/hill__cipher_8cpp_source.html#l00139">hill_cipher.cpp:139</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -591,7 +591,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -605,7 +605,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>std::pair<matrix<int>, matrix<int>> encryption and decryption keys as a pair</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>std::pair<<a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix<int></a>, <a class="el" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix<int></a>> encryption and decryption keys as a pair</dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#a642f70fb54cb50b00fb6df7c3f2b120e" title="Generate encryption matrix of a given size. Larger size matrices are difficult to generate but provid...">generate_encryption_key</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/db9/hill__cipher_8cpp_source.html#l00425">425</a> of file <a class="el" href="../../d7/db9/hill__cipher_8cpp_source.html">hill_cipher.cpp</a>.</p>
|
||||
@@ -643,7 +643,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -690,7 +690,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -715,7 +715,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -729,7 +729,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -825,7 +825,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -881,7 +881,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -902,7 +902,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T1 , typename T2 > </div>
|
||||
template<typename T1, typename T2> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -925,7 +925,7 @@ template<typename T1 , typename T2 > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -969,7 +969,7 @@ template<typename T1 , typename T2 > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T1 , typename T2 > </div>
|
||||
template<typename T1, typename T2> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -987,7 +987,7 @@ template<typename T1 , typename T2 > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1028,7 +1028,7 @@ template<typename T1 , typename T2 > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d4e/namespaceciphers.html">ciphers</a></li><li class="navelem"><a class="el" href="../../d6/d26/classciphers_1_1_hill_cipher.html">HillCipher</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/house_robber.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -270,7 +270,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -285,7 +285,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 69</span> std::vector<uint32_t> array1 = {1, 2, 3, 1};</div>
|
||||
<div class="line"><span class="lineno"> 70</span> std::cout << <span class="stringliteral">"Test 1... "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 71</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 72</span> dynamic_programming::house_robber::houseRobber(array1, array1.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 72</span> <a class="code hl_function" href="#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array1, array1.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 73</span> 4); <span class="comment">// here the two non-adjacent houses that are robbed are first and</span></div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="comment">// third with total sum money as 4</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
@@ -295,7 +295,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 79</span> std::vector<uint32_t> array2 = {6, 7, 1, 3, 8, 2, 4};</div>
|
||||
<div class="line"><span class="lineno"> 80</span> std::cout << <span class="stringliteral">"Test 2... "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 81</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 82</span> dynamic_programming::house_robber::houseRobber(array2, array2.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 82</span> <a class="code hl_function" href="#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array2, array2.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 83</span> 19); <span class="comment">// here the four non-adjacent houses that are robbed are first,</span></div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="comment">// third, fifth and seventh with total sum money as 19</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
@@ -305,7 +305,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 89</span> std::vector<uint32_t> array3 = {};</div>
|
||||
<div class="line"><span class="lineno"> 90</span> std::cout << <span class="stringliteral">"Test 3... "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 91</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 92</span> dynamic_programming::house_robber::houseRobber(array3, array3.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_function" href="#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array3, array3.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 93</span> 0); <span class="comment">// since there is no house no money can be robbed</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 95</span> </div>
|
||||
@@ -314,11 +314,12 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 98</span> std::vector<uint32_t> array4 = {2, 7, 9, 3, 1};</div>
|
||||
<div class="line"><span class="lineno"> 99</span> std::cout << <span class="stringliteral">"Test 4... "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 100</span> assert(</div>
|
||||
<div class="line"><span class="lineno"> 101</span> dynamic_programming::house_robber::houseRobber(array4, array4.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <a class="code hl_function" href="#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array4, array4.size()) ==</div>
|
||||
<div class="line"><span class="lineno"> 102</span> 12); <span class="comment">// here the three non-adjacent houses that are robbed are first,</span></div>
|
||||
<div class="line"><span class="lineno"> 103</span> <span class="comment">// third and fifth with total sum money as 12</span></div>
|
||||
<div class="line"><span class="lineno"> 104</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 105</span>}</div>
|
||||
<div class="ttc" id="ahouse__robber_8cpp_html_a1e497c3e3f169afe5baaae6a5d40cbc8"><div class="ttname"><a href="#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a></div><div class="ttdeci">std::uint32_t houseRobber(const std::vector< uint32_t > &money, const uint32_t &n)</div><div class="ttdoc">The main function that implements the House Robber algorithm using dynamic programming.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d26/house__robber_8cpp_source.html#l00036">house_robber.cpp:36</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -328,7 +329,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d6/d26/house__robber_8cpp.html">house_robber.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var house__robber_8cpp =
|
||||
[
|
||||
[ "houseRobber", "d6/d26/house__robber_8cpp.html#a1e497c3e3f169afe5baaae6a5d40cbc8", null ],
|
||||
[ "dynamic_programming::house_robber::houseRobber", "d6/d26/house__robber_8cpp.html#a1e497c3e3f169afe5baaae6a5d40cbc8", null ],
|
||||
[ "main", "d6/d26/house__robber_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/d26/house__robber_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/house_robber.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
<div class="headertitle"><div class="title">house_robber.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d26/house__robber_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d26/house__robber_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <climits></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cstdint></span> </div>
|
||||
@@ -159,7 +160,7 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>} <span class="comment">// namespace house_robber</span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>} <span class="comment">// namespace dynamic_programming</span></div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span></div>
|
||||
<div class="foldopen" id="foldopen00066" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="../../d6/d26/house__robber_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 66</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="comment">// Test 1</span></div>
|
||||
@@ -167,7 +168,7 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> std::vector<uint32_t> array1 = {1, 2, 3, 1};</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> std::cout << <span class="stringliteral">"Test 1... "</span>;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> assert(</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> dynamic_programming::house_robber::houseRobber(array1, array1.size()) ==</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array1, array1.size()) ==</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> 4); <span class="comment">// here the two non-adjacent houses that are robbed are first and</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="comment">// third with total sum money as 4</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
@@ -177,7 +178,7 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<uint32_t> array2 = {6, 7, 1, 3, 8, 2, 4};</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::cout << <span class="stringliteral">"Test 2... "</span>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> assert(</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> dynamic_programming::house_robber::houseRobber(array2, array2.size()) ==</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array2, array2.size()) ==</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> 19); <span class="comment">// here the four non-adjacent houses that are robbed are first,</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// third, fifth and seventh with total sum money as 19</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
@@ -187,7 +188,7 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::vector<uint32_t> array3 = {};</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> std::cout << <span class="stringliteral">"Test 3... "</span>;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> assert(</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> dynamic_programming::house_robber::houseRobber(array3, array3.size()) ==</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array3, array3.size()) ==</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> 0); <span class="comment">// since there is no house no money can be robbed</span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||
@@ -196,13 +197,13 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> std::vector<uint32_t> array4 = {2, 7, 9, 3, 1};</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> std::cout << <span class="stringliteral">"Test 4... "</span>;</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> assert(</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> dynamic_programming::house_robber::houseRobber(array4, array4.size()) ==</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#a1e497c3e3f169afe5baaae6a5d40cbc8">dynamic_programming::house_robber::houseRobber</a>(array4, array4.size()) ==</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> 12); <span class="comment">// here the three non-adjacent houses that are robbed are first,</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// third and fifth with total sum money as 12</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::cout << <span class="stringliteral">"passed"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span></div>
|
||||
<div class="foldopen" id="foldopen00111" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="../../d6/d26/house__robber_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 111</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_function" href="../../d6/d26/house__robber_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -220,7 +221,7 @@ $(function(){initNavTree('d6/d26/house__robber_8cpp_source.html','../../'); init
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d6/d26/house__robber_8cpp.html">house_robber.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: binary_search_tree< T >::bst_node Pages: 1 -->
|
||||
<svg width="197pt" height="283pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: binary_search_tree< T >::bst_node Pages: 1 -->
|
||||
<svg width="197pt" height="283pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers/caesar_cipher.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -213,12 +213,11 @@ Algorithm</h3>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span>(place_value < 0) { <span class="comment">// Handling case where remainder is negative </span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> place_value = place_value + 26;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">char</span> new_char = <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(place_value); <span class="comment">// Getting original character from decrypted value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">char</span> new_char = get_char(place_value); <span class="comment">// Getting original character from decrypted value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> decrypted_text += new_char; <span class="comment">// Appending decrypted character</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">return</span> decrypted_text; <span class="comment">// Returning decrypted text</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span> }</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a9e98c180d32b04aab6f767cb0c13e1da"><div class="ttname"><a href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a></div><div class="ttdeci">char get_char(const std::string &input, std::size_t pos)</div><div class="ttdoc">Returns the character at pos after the input is padded.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00170">sha256.cpp:170</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -255,7 +254,7 @@ Algorithm</h3>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">for</span> (<span class="keywordtype">char</span> c : text) { <span class="comment">// Going through each character</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="keywordtype">int</span> place_value = get_value(c); <span class="comment">// Getting value of character (i.e. 0-25)</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> place_value = (place_value + shift) % 26; <span class="comment">// Applying encryption formula</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordtype">char</span> new_char = <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(place_value); <span class="comment">// Getting new character from new value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordtype">char</span> new_char = get_char(place_value); <span class="comment">// Getting new character from new value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> encrypted_text += new_char; <span class="comment">// Appending encrypted character</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> }</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">return</span> encrypted_text; <span class="comment">// Returning encrypted text</span></div>
|
||||
@@ -335,7 +334,7 @@ Algorithm</h3>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../d6/d2c/caesar__cipher_8cpp.html">caesar_cipher.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var caesar__cipher_8cpp =
|
||||
[
|
||||
[ "decrypt", "d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056", null ],
|
||||
[ "encrypt", "d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3", null ],
|
||||
[ "ciphers::caesar::decrypt", "d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056", null ],
|
||||
[ "ciphers::caesar::encrypt", "d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3", null ],
|
||||
[ "main", "d6/d2c/caesar__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers/caesar_cipher.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,19 +124,19 @@ $(function(){initNavTree('d6/d2c/caesar__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">caesar_cipher.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d2c/caesar__cipher_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d2c/caesar__cipher_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <string></span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d4e/namespaceciphers.html">ciphers</a> {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d81/namespacecaesar.html">caesar</a> { </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">namespace </span>{</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">inline</span> <span class="keywordtype">char</span> <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x) {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">namespace </span>{ </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">inline</span> <span class="keywordtype">char</span> get_char(<span class="keyword">const</span> <span class="keywordtype">int</span> x) {</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// By adding 65 we are scaling 0-25 to 65-90. </span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// Which are in fact ASCII values of A-Z. </span></div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">return</span> char(x + 65); </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> }</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> } </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> get_value(<span class="keyword">const</span> <span class="keywordtype">char</span> c) {</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="comment">// A-Z have ASCII values in range 65-90.</span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="comment">// Hence subtracting 65 will scale them to 0-25.</span></div>
|
||||
@@ -144,7 +144,7 @@ $(function(){initNavTree('d6/d2c/caesar__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> }</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> } <span class="comment">// Unnamed namespace</span></div>
|
||||
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3"> 65</a></span> std::string encrypt (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &shift) {</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3"> 65</a></span> std::string <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3">encrypt</a> (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &shift) {</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::string encrypted_text = <span class="stringliteral">""</span>; <span class="comment">// Empty string to store encrypted text</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">for</span> (<span class="keywordtype">char</span> c : text) { <span class="comment">// Going through each character</span></div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">int</span> place_value = get_value(c); <span class="comment">// Getting value of character (i.e. 0-25)</span></div>
|
||||
@@ -155,8 +155,9 @@ $(function(){initNavTree('d6/d2c/caesar__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> encrypted_text; <span class="comment">// Returning encrypted text</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
|
||||
<div class="foldopen" id="foldopen00081" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="../../d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056"> 81</a></span> std::string decrypt (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &shift) {</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="../../d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056"> 81</a></span> std::string <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056">decrypt</a> (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &shift) {</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> std::string decrypted_text = <span class="stringliteral">""</span>; <span class="comment">// Empty string to store decrypted text</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">for</span> (<span class="keywordtype">char</span> c : text) { <span class="comment">// Going through each character</span></div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">int</span> place_value = get_value(c); <span class="comment">// Getting value of character (i.e. 0-25)</span></div>
|
||||
@@ -172,28 +173,28 @@ $(function(){initNavTree('d6/d2c/caesar__cipher_8cpp_source.html','../../'); ini
|
||||
</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> } <span class="comment">// namespace caesar</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>} <span class="comment">// namespace ciphers</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span></div>
|
||||
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002"> 100</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>() {</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> std::string text1 = <span class="stringliteral">"ALANTURING"</span>;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::string encrypted1 = ciphers::caesar::encrypt(text1, 17);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::string decrypted1 = ciphers::caesar::decrypt(encrypted1, 17);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::string encrypted1 = <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3">ciphers::caesar::encrypt</a>(text1, 17);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::string decrypted1 = <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056">ciphers::caesar::decrypt</a>(encrypted1, 17);</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> assert(text1 == decrypted1);</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> std::cout << <span class="stringliteral">"Original text : "</span> << text1;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::cout << <span class="stringliteral">" , Encrypted text (with shift = 21) : "</span> << encrypted1;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::cout << <span class="stringliteral">" , Decrypted text : "</span><< decrypted1 << std::endl;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::string text2 = <span class="stringliteral">"HELLOWORLD"</span>;</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::string encrypted2 = ciphers::caesar::encrypt(text2, 1729);</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> std::string decrypted2 = ciphers::caesar::decrypt(encrypted2, 1729);</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::string encrypted2 = <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3">ciphers::caesar::encrypt</a>(text2, 1729);</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> std::string decrypted2 = <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056">ciphers::caesar::decrypt</a>(encrypted2, 1729);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> assert(text2 == decrypted2);</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::cout << <span class="stringliteral">"Original text : "</span> << text2;</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::cout << <span class="stringliteral">" , Encrypted text (with shift = 1729) : "</span> << encrypted2;</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::cout << <span class="stringliteral">" , Decrypted text : "</span><< decrypted2 << std::endl;</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span></div>
|
||||
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="../../d6/d2c/caesar__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 120</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="comment">// Testing</span></div>
|
||||
@@ -201,18 +202,19 @@ $(function(){initNavTree('d6/d2c/caesar__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_a355e69511cd2006b5c4c80ae95b71056"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#a355e69511cd2006b5c4c80ae95b71056">ciphers::caesar::decrypt</a></div><div class="ttdeci">std::string decrypt(const std::string &text, const int &shift)</div><div class="ttdef"><b>Definition</b> <a href="#l00081">caesar_cipher.cpp:81</a></div></div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ac3381121289548640b1c27a58a8524c3"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ac3381121289548640b1c27a58a8524c3">ciphers::caesar::encrypt</a></div><div class="ttdeci">std::string encrypt(const std::string &text, const int &shift)</div><div class="ttdef"><b>Definition</b> <a href="#l00065">caesar_cipher.cpp:65</a></div></div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="#l00100">caesar_cipher.cpp:100</a></div></div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00120">caesar_cipher.cpp:120</a></div></div>
|
||||
<div class="ttc" id="anamespacecaesar_html"><div class="ttname"><a href="../../dd/d81/namespacecaesar.html">caesar</a></div><div class="ttdoc">Functions for Caesar cipher algorithm.</div></div>
|
||||
<div class="ttc" id="anamespaceciphers_html"><div class="ttname"><a href="../../d6/d4e/namespaceciphers.html">ciphers</a></div><div class="ttdoc">Algorithms for encryption and decryption.</div></div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a9e98c180d32b04aab6f767cb0c13e1da"><div class="ttname"><a href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a></div><div class="ttdeci">char get_char(const std::string &input, std::size_t pos)</div><div class="ttdoc">Returns the character at pos after the input is padded.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00170">sha256.cpp:170</a></div></div>
|
||||
</div><!-- fragment --></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="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../d6/d2c/caesar__cipher_8cpp.html">caesar_cipher.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/modular_inverse_simple.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -247,7 +247,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -284,7 +284,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/d2d/modular__inverse__simple_8cpp.html">modular_inverse_simple.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/modular_inverse_simple.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d6/d2d/modular__inverse__simple_8cpp_source.html','../
|
||||
<div class="headertitle"><div class="title">modular_inverse_simple.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d2d/modular__inverse__simple_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d2d/modular__inverse__simple_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span></div>
|
||||
<div class="foldopen" id="foldopen00021" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../d6/d2d/modular__inverse__simple_8cpp.html#a618b198f74a88ab0023355b3a05d9ad6"> 21</a></span>uint64_t <a class="code hl_function" href="../../d6/d2d/modular__inverse__simple_8cpp.html#a618b198f74a88ab0023355b3a05d9ad6">imod</a>(uint64_t x, uint64_t y) {</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> uint64_t aux = 0; <span class="comment">// auxiliary variable</span></div>
|
||||
@@ -142,7 +143,7 @@ $(function(){initNavTree('d6/d2d/modular__inverse__simple_8cpp_source.html','../
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">return</span> aux / x;</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
|
||||
<div class="foldopen" id="foldopen00037" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../d6/d2d/modular__inverse__simple_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 37</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d2d/modular__inverse__simple_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> std::cout << <span class="stringliteral">"First case testing... \n"</span>;</div>
|
||||
@@ -163,6 +164,7 @@ $(function(){initNavTree('d6/d2d/modular__inverse__simple_8cpp_source.html','../
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> std::cout << <span class="stringliteral">"\nAll test cases have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span></div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d6/d2d/modular__inverse__simple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 59</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d2d/modular__inverse__simple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_function" href="../../d6/d2d/modular__inverse__simple_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -177,7 +179,7 @@ $(function(){initNavTree('d6/d2d/modular__inverse__simple_8cpp_source.html','../
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/d2d/modular__inverse__simple_8cpp.html">modular_inverse_simple.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: range_queries/fenwick_tree.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -218,7 +218,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -250,7 +250,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d6/d2e/fenwick__tree_8cpp.html">fenwick_tree.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: range_queries/fenwick_tree.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,18 +124,19 @@ $(function(){initNavTree('d6/d2e/fenwick__tree_8cpp_source.html','../../'); init
|
||||
<div class="headertitle"><div class="title">fenwick_tree.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d2e/fenwick__tree_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d2e/fenwick__tree_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
||||
<div class="foldopen" id="foldopen00028" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../dd/d69/namespacerange__queries.html"> 28</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d69/namespacerange__queries.html">range_queries</a> {</div>
|
||||
<div class="foldopen" id="foldopen00032" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html"> 32</a></span><span class="keyword">class </span><a class="code hl_class" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html">fenwick_tree</a> {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html"> 32</a></span><span class="keyword">class </span><a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a5ea37183524553bbf2234a36a44a4b9a">fenwick_tree</a> {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af9f543aa5976b8cc5422490b3d6250c6"> 33</a></span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af9f543aa5976b8cc5422490b3d6250c6">n</a> = 0; </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af7b7a8c1c5724ed8683d7e28bef526e6"> 34</a></span> std::vector<int> <a class="code hl_variable" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af7b7a8c1c5724ed8683d7e28bef526e6">bit</a>{}; </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#ab492ebf07cab0e3c32d277ad986de801"> 41</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#ab492ebf07cab0e3c32d277ad986de801">offset</a>(<span class="keywordtype">int</span> x) { <span class="keywordflow">return</span> (x & (-x)); }</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
@@ -147,10 +148,10 @@ $(function(){initNavTree('d6/d2e/fenwick__tree_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#aef7ba885b91af093e9e514358fa0f36c"> 64</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#aef7ba885b91af093e9e514358fa0f36c">fenwick_tree</a>(T x) : <a class="code hl_variable" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af9f543aa5976b8cc5422490b3d6250c6">n</a>(x) { <a class="code hl_variable" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af7b7a8c1c5724ed8683d7e28bef526e6">bit</a>.assign(<a class="code hl_variable" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#af9f543aa5976b8cc5422490b3d6250c6">n</a> + 1, 0); }</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00075" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a19dea5e88bbd7683a719030623315de9"> 75</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a19dea5e88bbd7683a719030623315de9">update</a>(T <span class="keywordtype">id</span>, T val) {</div>
|
||||
@@ -161,7 +162,7 @@ $(function(){initNavTree('d6/d2e/fenwick__tree_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span></div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00090" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a1fa0559d987fde0044761b17b35f5abd"> 90</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a1fa0559d987fde0044761b17b35f5abd">sum</a>(T <span class="keywordtype">id</span>) {</div>
|
||||
@@ -174,13 +175,13 @@ $(function(){initNavTree('d6/d2e/fenwick__tree_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">return</span> res;</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a0914a4b1401a7c427de91c92885724fe"> 106</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a0914a4b1401a7c427de91c92885724fe">sum_range</a>(<span class="keywordtype">int</span> l, <span class="keywordtype">int</span> r) { <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a1fa0559d987fde0044761b17b35f5abd">sum</a>(r) - <a class="code hl_function" href="../../de/d0d/classrange__queries_1_1fenwick__tree.html#a1fa0559d987fde0044761b17b35f5abd">sum</a>(l - 1); }</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>} <span class="comment">// namespace range_queries</span></div>
|
||||
</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span></div>
|
||||
<div class="foldopen" id="foldopen00114" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="../../d6/d2e/fenwick__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 114</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d2e/fenwick__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::vector<int> arr = {1, 2, 3, 4, 5};</div>
|
||||
@@ -196,7 +197,7 @@ $(function(){initNavTree('d6/d2e/fenwick__tree_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> std::cout << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span></div>
|
||||
<div class="foldopen" id="foldopen00132" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="../../d6/d2e/fenwick__tree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 132</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d2e/fenwick__tree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <a class="code hl_function" href="../../d6/d2e/fenwick__tree_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -221,7 +222,7 @@ $(function(){initNavTree('d6/d2e/fenwick__tree_8cpp_source.html','../../'); init
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d6/d2e/fenwick__tree_8cpp.html">fenwick_tree.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: machine_learning::adaline Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -203,7 +203,7 @@ Friends</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -257,13 +257,12 @@ Friends</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Defines activation function as Heaviside's step function. </p><p class="formulaDsp">
|
||||
\[
|
||||
f(x) = \begin{cases}
|
||||
\[f(x) = \begin{cases}
|
||||
-1 & \forall x \le 0\\
|
||||
1 & \forall x > 0
|
||||
\end{cases}
|
||||
@@ -300,7 +299,7 @@ f(x) = \begin{cases}
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -350,7 +349,7 @@ f(x) = \begin{cases}
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -411,7 +410,7 @@ template<size_t N> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -481,7 +480,7 @@ template<size_t N> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -538,7 +537,7 @@ template<size_t N> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel friend">friend</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -575,7 +574,7 @@ template<size_t N> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -601,7 +600,7 @@ template<size_t N> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -627,7 +626,7 @@ template<size_t N> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -647,7 +646,7 @@ template<size_t N> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d8/d77/namespacemachine__learning.html">machine_learning</a></li><li class="navelem"><a class="el" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: statistics::stats_computer1< T > Pages: 1 -->
|
||||
<svg width="167pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: statistics::stats_computer1< T > Pages: 1 -->
|
||||
<svg width="167pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/find_non_repeating_number.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -259,7 +259,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -297,7 +297,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d6/d38/find__non__repeating__number_8cpp.html">find_non_repeating_number.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
2
d6/d38/find__non__repeating__number_8cpp.js
vendored
@@ -1,6 +1,6 @@
|
||||
var find__non__repeating__number_8cpp =
|
||||
[
|
||||
[ "find_non_repeating_integer", "d6/d38/find__non__repeating__number_8cpp.html#ac5ca4c0be0967b4dd572507f50451ae3", null ],
|
||||
[ "bit_manipulation::find_non_repeating_integer::find_non_repeating_integer", "d6/d38/find__non__repeating__number_8cpp.html#ac5ca4c0be0967b4dd572507f50451ae3", null ],
|
||||
[ "main", "d6/d38/find__non__repeating__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/d38/find__non__repeating__number_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: bit_manipulation/find_non_repeating_number.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d6/d38/find__non__repeating__number_8cpp_source.html',
|
||||
<div class="headertitle"><div class="title">find_non_repeating_number.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d38/find__non__repeating__number_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d38/find__non__repeating__number_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a> {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d2/da7/namespacefind__non__repeating__integer.html">find_non_repeating_integer</a> {</div>
|
||||
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
|
||||
@@ -151,7 +152,7 @@ $(function(){initNavTree('d6/d38/find__non__repeating__number_8cpp_source.html',
|
||||
</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span>} <span class="comment">// namespace find_non_repeating_integer</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span>} <span class="comment">// namespace bit_manipulation</span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span></div>
|
||||
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../d6/d38/find__non__repeating__number_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 62</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d38/find__non__repeating__number_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// n = 10,2 return 14</span></div>
|
||||
@@ -173,6 +174,7 @@ $(function(){initNavTree('d6/d38/find__non__repeating__number_8cpp_source.html',
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::cout << <span class="stringliteral">"All test cases successfully passed!"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="foldopen" id="foldopen00085" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../d6/d38/find__non__repeating__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 85</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d38/find__non__repeating__number_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <a class="code hl_function" href="../../d6/d38/find__non__repeating__number_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -189,7 +191,7 @@ $(function(){initNavTree('d6/d38/find__non__repeating__number_8cpp_source.html',
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d6/d38/find__non__repeating__number_8cpp.html">find_non_repeating_number.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/newton_raphson_method.cpp Pages: 1 -->
|
||||
<svg width="301pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/newton_raphson_method.cpp Pages: 1 -->
|
||||
<svg width="301pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/miller_rabin.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -140,16 +140,16 @@ Include dependency graph for miller_rabin.cpp:</div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a091662a787d5ad4866713021f580fddb" id="r_a091662a787d5ad4866713021f580fddb"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a091662a787d5ad4866713021f580fddb" id="r_a091662a787d5ad4866713021f580fddb"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a091662a787d5ad4866713021f580fddb"><td class="memTemplItemLeft" align="right" valign="top">std::vector< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a091662a787d5ad4866713021f580fddb">reverse_binary</a> (T num)</td></tr>
|
||||
<tr class="separator:a091662a787d5ad4866713021f580fddb"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ad6c2c67ea416d0e80003a88623f98b29" id="r_ad6c2c67ea416d0e80003a88623f98b29"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:ad6c2c67ea416d0e80003a88623f98b29" id="r_ad6c2c67ea416d0e80003a88623f98b29"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:ad6c2c67ea416d0e80003a88623f98b29"><td class="memTemplItemLeft" align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad6c2c67ea416d0e80003a88623f98b29">modular_exponentiation</a> (T base, const std::vector< T > &rev_binary_exponent, T mod)</td></tr>
|
||||
<tr class="separator:ad6c2c67ea416d0e80003a88623f98b29"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6f9c31c1047aa3191676d64571d4c506" id="r_a6f9c31c1047aa3191676d64571d4c506"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a6f9c31c1047aa3191676d64571d4c506" id="r_a6f9c31c1047aa3191676d64571d4c506"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a6f9c31c1047aa3191676d64571d4c506"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a6f9c31c1047aa3191676d64571d4c506">miller_test</a> (T d, T num)</td></tr>
|
||||
<tr class="separator:a6f9c31c1047aa3191676d64571d4c506"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a901288288ef5ebe8e97414cc30797cce" id="r_a901288288ef5ebe8e97414cc30797cce"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a901288288ef5ebe8e97414cc30797cce" id="r_a901288288ef5ebe8e97414cc30797cce"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a901288288ef5ebe8e97414cc30797cce"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a901288288ef5ebe8e97414cc30797cce">miller_rabin_primality_test</a> (T num, T repeats)</td></tr>
|
||||
<tr class="separator:a901288288ef5ebe8e97414cc30797cce"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a88ec9ad42717780d6caaff9d3d6977f9" id="r_a88ec9ad42717780d6caaff9d3d6977f9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a> ()</td></tr>
|
||||
@@ -194,7 +194,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">bool miller_rabin_primality_test </td>
|
||||
@@ -258,7 +258,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">bool miller_test </td>
|
||||
@@ -326,7 +326,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">T modular_exponentiation </td>
|
||||
@@ -385,7 +385,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">std::vector< T > reverse_binary </td>
|
||||
@@ -466,7 +466,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/d42/miller__rabin_8cpp.html">miller_rabin.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/miller_rabin.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,13 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div class="headertitle"><div class="title">miller_rabin.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d42/miller__rabin_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d42/miller__rabin_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <random></span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00019" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="../../d6/d42/miller__rabin_8cpp.html#a091662a787d5ad4866713021f580fddb"> 19</a></span>std::vector<T> <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#a091662a787d5ad4866713021f580fddb">reverse_binary</a>(T num) {</div>
|
||||
@@ -142,7 +143,7 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d6/d42/miller__rabin_8cpp.html#ad6c2c67ea416d0e80003a88623f98b29"> 43</a></span>T <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#ad6c2c67ea416d0e80003a88623f98b29">modular_exponentiation</a>(T base, <span class="keyword">const</span> std::vector<T> &rev_binary_exponent,</div>
|
||||
@@ -166,7 +167,7 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> b;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00073" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="../../d6/d42/miller__rabin_8cpp.html#a6f9c31c1047aa3191676d64571d4c506"> 73</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#a6f9c31c1047aa3191676d64571d4c506">miller_test</a>(T d, T num) {</div>
|
||||
@@ -200,7 +201,7 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span></div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00125" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="../../d6/d42/miller__rabin_8cpp.html#a901288288ef5ebe8e97414cc30797cce"> 125</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#a901288288ef5ebe8e97414cc30797cce">miller_rabin_primality_test</a>(T num, T repeats) {</div>
|
||||
@@ -231,7 +232,7 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span></div>
|
||||
<div class="foldopen" id="foldopen00157" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"><a class="line" href="../../d6/d42/miller__rabin_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9"> 157</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>() {</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// First test on 2</span></div>
|
||||
@@ -256,7 +257,7 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> std::cout << <span class="stringliteral">"Fifth test passes."</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span></div>
|
||||
<div class="foldopen" id="foldopen00183" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="../../d6/d42/miller__rabin_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 183</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <a class="code hl_function" href="../../d6/d42/miller__rabin_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
@@ -276,7 +277,7 @@ $(function(){initNavTree('d6/d42/miller__rabin_8cpp_source.html','../../'); init
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/d42/miller__rabin_8cpp.html">miller_rabin.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers::elliptic_curve_key_exchange::Point Struct Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -181,7 +181,7 @@ Friends</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -225,7 +225,7 @@ Friends</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel friend">friend</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -290,7 +290,7 @@ Friends</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d4e/namespaceciphers.html">ciphers</a></li><li class="navelem"><a class="el" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html">elliptic_curve_key_exchange</a></li><li class="navelem"><a class="el" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: range_queries::perSegTree Pages: 1 -->
|
||||
<!--zoomable 136 -->
|
||||
|
||||
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: range_queries::perSegTree Pages: 1 -->
|
||||
<svg width="549pt" height="136pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/addition_rule.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -252,7 +252,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d6/d4a/addition__rule_8cpp.html">addition_rule.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/addition_rule.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,21 +124,21 @@ $(function(){initNavTree('d6/d4a/addition__rule_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">addition_rule.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d4a/addition__rule_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d4a/addition__rule_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span></div>
|
||||
<div class="foldopen" id="foldopen00014" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="../../d6/d4a/addition__rule_8cpp.html#a4adfd055c758546456d440ee9133555d"> 14</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/d4a/addition__rule_8cpp.html#a4adfd055c758546456d440ee9133555d">addition_rule_independent</a>(<span class="keywordtype">double</span> A, <span class="keywordtype">double</span> B) {</div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">return</span> (A + B) - (A * B);</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span></div>
|
||||
<div class="foldopen" id="foldopen00025" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d6/d4a/addition__rule_8cpp.html#a565ffcbbdbe496ced37250bc8dc36bc0"> 25</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/d4a/addition__rule_8cpp.html#a565ffcbbdbe496ced37250bc8dc36bc0">addition_rule_dependent</a>(<span class="keywordtype">double</span> A, <span class="keywordtype">double</span> B, <span class="keywordtype">double</span> B_given_A) {</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> (A + B) - (A * B_given_A);</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span></div>
|
||||
<div class="foldopen" id="foldopen00030" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d6/d4a/addition__rule_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 30</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d4a/addition__rule_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">double</span> A = 0.5;</div>
|
||||
@@ -163,7 +163,7 @@ $(function(){initNavTree('d6/d4a/addition__rule_8cpp_source.html','../../'); ini
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d6/d4a/addition__rule_8cpp.html">addition_rule.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/hamming_distance.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: bit_manipulation/hamming_distance.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/gcd_recursive_euclidean.cpp Pages: 1 -->
|
||||
<svg width="110pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/gcd_recursive_euclidean.cpp Pages: 1 -->
|
||||
<svg width="110pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/easter.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -151,13 +151,13 @@ $(function(){initNavTree('d6/d4e/easter_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment"> * @brief Contains information for Easter date</span></div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment"> */</span></div>
|
||||
<div class="foldopen" id="foldopen00027" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../d1/df6/class_easter_year_month_day.html"> 27</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d1/df6/class_easter_year_month_day.html">EasterYearMonthDay</a> {</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../d1/df6/class_easter_year_month_day.html"> 27</a></span><span class="keyword">class </span>EasterYearMonthDay {</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d1/df6/class_easter_year_month_day.html#a28d3cd09391390250932b7fb58fe61dc"> 29</a></span> uint64_t <a class="code hl_variable" href="../../d1/df6/class_easter_year_month_day.html#a28d3cd09391390250932b7fb58fe61dc">year</a>; </div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d1/df6/class_easter_year_month_day.html#a01a068eae0b6fa8f86f5f60c2840bbde"> 30</a></span> uint64_t <a class="code hl_variable" href="../../d1/df6/class_easter_year_month_day.html#a01a068eae0b6fa8f86f5f60c2840bbde">month</a>; </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../d1/df6/class_easter_year_month_day.html#ade0b934e5b1af24e19ff959673b2ec51"> 31</a></span> uint64_t <a class="code hl_variable" href="../../d1/df6/class_easter_year_month_day.html#ade0b934e5b1af24e19ff959673b2ec51">day</a>; </div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <a class="code hl_class" href="../../d1/df6/class_easter_year_month_day.html">EasterYearMonthDay</a>(uint64_t newYear, uint64_t newMonth, uint64_t newDay) {</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> EasterYearMonthDay(uint64_t newYear, uint64_t newMonth, uint64_t newDay) {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <a class="code hl_variable" href="../../d1/df6/class_easter_year_month_day.html#a28d3cd09391390250932b7fb58fe61dc">year</a> = newYear; <span class="comment">// Assigns year to class</span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <a class="code hl_variable" href="../../d1/df6/class_easter_year_month_day.html#a01a068eae0b6fa8f86f5f60c2840bbde">month</a> = newMonth;</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <a class="code hl_variable" href="../../d1/df6/class_easter_year_month_day.html#ade0b934e5b1af24e19ff959673b2ec51">day</a> = newDay;</div>
|
||||
@@ -205,8 +205,8 @@ $(function(){initNavTree('d6/d4e/easter_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> date;</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span>}</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>() {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// 2003 | April 20th</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> assert(findEaster(2003).month == 4); <span class="comment">// Should return true</span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> assert(findEaster(2003).day == 20); <span class="comment">// Should return true</span></div>
|
||||
@@ -223,12 +223,11 @@ $(function(){initNavTree('d6/d4e/easter_8cpp_source.html','../../'); initResizab
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> assert(findEaster(1400).month == 0); <span class="comment">// Should return true</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> assert(findEaster(1400).day == 0); <span class="comment">// Should return true</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span>}</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_function" href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>}</div>
|
||||
<div class="ttc" id="acaesar__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d6/d2c/caesar__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d2c/caesar__cipher_8cpp_source.html#l00100">caesar_cipher.cpp:100</a></div></div>
|
||||
<div class="ttc" id="aclass_easter_year_month_day_html"><div class="ttname"><a href="../../d1/df6/class_easter_year_month_day.html">EasterYearMonthDay</a></div><div class="ttdoc">for assert</div><div class="ttdef"><b>Definition</b> <a href="#l00027">easter.cpp:27</a></div></div>
|
||||
<div class="ttc" id="aclass_easter_year_month_day_html_a01a068eae0b6fa8f86f5f60c2840bbde"><div class="ttname"><a href="../../d1/df6/class_easter_year_month_day.html#a01a068eae0b6fa8f86f5f60c2840bbde">EasterYearMonthDay::month</a></div><div class="ttdeci">uint64_t month</div><div class="ttdoc">month Easter is on</div><div class="ttdef"><b>Definition</b> <a href="#l00030">easter.cpp:30</a></div></div>
|
||||
<div class="ttc" id="aclass_easter_year_month_day_html_a28d3cd09391390250932b7fb58fe61dc"><div class="ttname"><a href="../../d1/df6/class_easter_year_month_day.html#a28d3cd09391390250932b7fb58fe61dc">EasterYearMonthDay::year</a></div><div class="ttdeci">uint64_t year</div><div class="ttdoc">year Easter is on</div><div class="ttdef"><b>Definition</b> <a href="#l00029">easter.cpp:29</a></div></div>
|
||||
@@ -236,6 +235,7 @@ $(function(){initNavTree('d6/d4e/easter_8cpp_source.html','../../'); initResizab
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a2f67508d5f392b0321772169342c98ad"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">numerical_methods::simpson_method::g</a></div><div class="ttdeci">double g(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00115">composite_simpson_rule.cpp:115</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a4251b4df4748a0b9c43a48f61bdd2397"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a></div><div class="ttdeci">double f(double x)</div><div class="ttdoc">A function f(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00113">composite_simpson_rule.cpp:113</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00082">generate_parentheses.cpp:82</a></div></div>
|
||||
<div class="ttc" id="agenerate__parentheses_8cpp_html_gae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d1e/generate__parentheses_8cpp_source.html#l00110">generate_parentheses.cpp:110</a></div></div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a566eaf0ffafd50bc61e644561fd27001"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a></div><div class="ttdeci">int h(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00045">hash_search.cpp:45</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -244,7 +244,7 @@ $(function(){initNavTree('d6/d4e/easter_8cpp_source.html','../../'); initResizab
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><b>easter.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -177,7 +177,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -196,7 +196,7 @@ Variables</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d4e/namespaceciphers.html">ciphers</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: /Users/runner/work/C-Plus-Plus/C-Plus-Plus/math/iterative_factorial.cpp</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -127,14 +127,15 @@ $(function(){initNavTree('d6/d50/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
|
||||
<p>5! = 5 * 4 * 3 * 2 * 1</p>
|
||||
<p>Recursive implementation of factorial pseudocode:</p>
|
||||
<p>function factorial(n): if n == 1: return 1 else: return factorial(n-1)</p>
|
||||
<div class="fragment"><div class="line"> </div>
|
||||
<div class="fragment"><div class="line"></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><span class="preprocessor">#include <cstdint></span> </div>
|
||||
<div class="line"><span class="preprocessor">#include <exception></span> </div>
|
||||
<div class="line"><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"></div>
|
||||
<div class="line"><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"></div>
|
||||
<div class="line">uint64_t <a id="a0" name="a0"></a><a class="code hl_function" href="../../dd/d47/namespacemath.html#a2565c745aac2f9561cc6fd9e56d9b77a">iterativeFactorial</a>(uint8_t n) {</div>
|
||||
<div class="line"> <span class="keywordflow">if</span> (n > 20) {</div>
|
||||
<div class="line"> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">"Maximum n value is 20"</span>);</div>
|
||||
@@ -152,7 +153,7 @@ $(function(){initNavTree('d6/d50/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
|
||||
<div class="line">}</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line">} <span class="comment">// namespace math</span></div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"></div>
|
||||
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> <a id="a1" name="a1"></a><a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"> <span class="comment">// Special case test</span></div>
|
||||
<div class="line"> std::cout << <span class="stringliteral">"Exception case test \n"</span></div>
|
||||
@@ -199,7 +200,7 @@ $(function(){initNavTree('d6/d50/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
|
||||
<div class="line"> </div>
|
||||
<div class="line"> std::cout << <span class="stringliteral">"All tests have passed successfully.\n"</span>;</div>
|
||||
<div class="line">}</div>
|
||||
<div class="line"> </div>
|
||||
<div class="line"></div>
|
||||
<div class="line"><span class="keywordtype">int</span> <a id="a2" name="a2"></a><a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// Run self-test implementation</span></div>
|
||||
<div class="line"> <span class="keywordflow">return</span> 0;</div>
|
||||
@@ -213,7 +214,7 @@ $(function(){initNavTree('d6/d50/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: word_break Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d6/d53/namespaceword__break.html','../../'); initResiz
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d53/namespaceword__break.html">word_break</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: operations_on_datastructures/array_right_rotation.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -179,6 +179,12 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</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>
|
||||
<tr class="memitem:a6109193567a5b7e36a27f2b4865fce20" id="r_a6109193567a5b7e36a27f2b4865fce20"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">tests::print</a> (const std::vector< int32_t > &array)</td></tr>
|
||||
<tr class="memdesc:a6109193567a5b7e36a27f2b4865fce20"><td class="mdescLeft"> </td><td class="mdescRight">Prints the values of a vector sequentially, ending with a newline character. <br /></td></tr>
|
||||
<tr class="separator:a6109193567a5b7e36a27f2b4865fce20"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a1bfb8711f49e591eb168ccaa3df6fb86" id="r_a1bfb8711f49e591eb168ccaa3df6fb86"><td class="memItemLeft" align="right" valign="top">std::vector< int32_t > </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">tests::shift_right</a> (const std::vector< int32_t > &array, size_t shift)</td></tr>
|
||||
<tr class="memdesc:a1bfb8711f49e591eb168ccaa3df6fb86"><td class="mdescLeft"> </td><td class="mdescRight">Shifts the given vector to the right by the shift amount and returns a new vector with the result. The original vector is not mutated. <br /></td></tr>
|
||||
<tr class="separator:a1bfb8711f49e591eb168ccaa3df6fb86"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Implementation for the <a href="https://www.javatpoint.com/program-to-right-rotate-the-elements-of-an-array" target="_blank">Array right Rotation</a> algorithm. </p>
|
||||
@@ -232,7 +238,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -262,7 +268,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d6/d57/array__right__rotation_8cpp.html">array_right_rotation.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
var array__right__rotation_8cpp =
|
||||
[
|
||||
[ "main", "d6/d57/array__right__rotation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "print", "d6/d57/array__right__rotation_8cpp.html#a6109193567a5b7e36a27f2b4865fce20", null ],
|
||||
[ "shift_right", "d6/d57/array__right__rotation_8cpp.html#a1bfb8711f49e591eb168ccaa3df6fb86", null ],
|
||||
[ "operations_on_datastructures::print", "da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20", null ],
|
||||
[ "tests::print", "d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20", null ],
|
||||
[ "operations_on_datastructures::shift_right", "da/d6d/namespaceoperations__on__datastructures.html#a1bfb8711f49e591eb168ccaa3df6fb86", null ],
|
||||
[ "tests::shift_right", "d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86", null ],
|
||||
[ "test", "d6/d57/array__right__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "test1", "d6/d57/array__right__rotation_8cpp.html#a167c24bd817469ae47358d12e034f2d5", null ],
|
||||
[ "test2", "d6/d57/array__right__rotation_8cpp.html#abdd77344d4af8fd56d14a5cabbf2f669", null ],
|
||||
[ "test3", "d6/d57/array__right__rotation_8cpp.html#aa515639572647508b94986489aab6d76", null ],
|
||||
[ "test4", "d6/d57/array__right__rotation_8cpp.html#a2b9769e44683dcb67fe1083ad91e134d", null ],
|
||||
[ "test5", "d6/d57/array__right__rotation_8cpp.html#af7b81d7a1534216af6a36a80135beb86", null ]
|
||||
[ "tests::test1", "d9/df4/namespacetests.html#a167c24bd817469ae47358d12e034f2d5", null ],
|
||||
[ "tests::test2", "d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669", null ],
|
||||
[ "tests::test3", "d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76", null ],
|
||||
[ "tests::test4", "d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d", null ],
|
||||
[ "tests::test5", "d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: operations_on_datastructures/array_right_rotation.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,20 +124,21 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="headertitle"><div class="title">array_right_rotation.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d57/array__right__rotation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d57/array__right__rotation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a> {</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(<span class="keyword">const</span> std::vector<int32_t> &array) {</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">for</span> (int32_t i : array) {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> std::cout << i << <span class="stringliteral">" "</span>; </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> }</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> std::cout << <span class="stringliteral">"\n"</span>; </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span>}</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../da/d6d/namespaceoperations__on__datastructures.html#a1bfb8711f49e591eb168ccaa3df6fb86"> 47</a></span>std::vector<int32_t> <a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#a1bfb8711f49e591eb168ccaa3df6fb86">shift_right</a>(<span class="keyword">const</span> std::vector<int32_t> &array,</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">size_t</span> shift) {</div>
|
||||
@@ -157,7 +158,7 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>} <span class="comment">// namespace operations_on_datastructures</span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span></div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/df4/namespacetests.html">tests</a> {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="keyword">using </span><a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20">operations_on_datastructures::print</a>;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="keyword">using </span><a class="code hl_function" href="../../da/d6d/namespaceoperations__on__datastructures.html#a1bfb8711f49e591eb168ccaa3df6fb86">operations_on_datastructures::shift_right</a>;</div>
|
||||
@@ -166,10 +167,10 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::cout << <span class="stringliteral">"Initialized arr = {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::cout << <span class="stringliteral">"Expected result: {4, 5, 1, 2, 3}\n"</span>;</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::vector<int32_t> arr = {1, 2, 3, 4, 5};</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> std::vector<int32_t> res = shift_right(arr, 2);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">shift_right</a>(arr, 2);</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> std::vector<int32_t> expected = {4, 5, 1, 2, 3};</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> print(res); </div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span>}</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669">test2</a>() {</div>
|
||||
@@ -177,10 +178,10 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::cout << <span class="stringliteral">"Initialized arr = {}\n"</span>;</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"Expected result: {}\n"</span>;</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::vector<int32_t> arr = {};</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::vector<int32_t> res = shift_right(arr, 2);</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">shift_right</a>(arr, 2);</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> std::vector<int32_t> expected = {};</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> print(res); </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span>}</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76">test3</a>() {</div>
|
||||
@@ -188,10 +189,10 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::cout << <span class="stringliteral">"Initialized arr = {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> std::cout << <span class="stringliteral">"Expected result: {}\n"</span>;</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::vector<int32_t> arr = {1, 2, 3, 4, 5};</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::vector<int32_t> res = shift_right(arr, 7); </div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">shift_right</a>(arr, 7); </div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> std::vector<int32_t> expected = {};</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> print(res); </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span>}</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d">test4</a>() {</div>
|
||||
@@ -202,15 +203,15 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= 210; i++) {</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> arr.push_back(i * 2);</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> print(arr);</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::vector<int32_t> res = shift_right(arr, 1);</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(arr);</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">shift_right</a>(arr, 1);</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::vector<int32_t> expected;</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> expected.push_back(420);</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < 209; i++) {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> expected.push_back(arr[i]);</div>
|
||||
<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> assert(res == expected);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> print(res); </div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span>}</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86">test5</a>() {</div>
|
||||
@@ -218,13 +219,13 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::cout << <span class="stringliteral">"Initialized arr = {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> std::cout << <span class="stringliteral">"Expected result: {1, 2, 3, 4, 5}\n"</span>;</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> std::vector<int32_t> arr = {1, 2, 3, 4, 5};</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> std::vector<int32_t> res = shift_right(arr, 0);</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> std::vector<int32_t> res = <a class="code hl_function" href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">shift_right</a>(arr, 0);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> assert(res == arr);</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> print(res); </div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">print</a>(res); </div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> std::cout << <span class="stringliteral">"TEST PASSED!\n\n"</span>;</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span>}</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span>} <span class="comment">// namespace tests</span></div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span></div>
|
||||
<div class="foldopen" id="foldopen00160" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="../../d6/d57/array__right__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 160</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d57/array__right__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#a167c24bd817469ae47358d12e034f2d5">tests::test1</a>();</div>
|
||||
@@ -234,7 +235,7 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_function" href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86">tests::test5</a>();</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span></div>
|
||||
<div class="foldopen" id="foldopen00172" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"><a class="line" href="../../d6/d57/array__right__rotation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 172</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d57/array__right__rotation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <a class="code hl_function" href="../../d6/d57/array__right__rotation_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -248,7 +249,9 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div class="ttc" id="anamespaceoperations__on__datastructures_html_a6109193567a5b7e36a27f2b4865fce20"><div class="ttname"><a href="../../da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20">operations_on_datastructures::print</a></div><div class="ttdeci">void print(const std::vector< int32_t > &array)</div><div class="ttdoc">Prints the values of a vector sequentially, ending with a newline character.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00029">array_left_rotation.cpp:29</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html"><div class="ttname"><a href="../../d9/df4/namespacetests.html">tests</a></div><div class="ttdoc">Testcases to check Union of Two Arrays.</div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a167c24bd817469ae47358d12e034f2d5"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a167c24bd817469ae47358d12e034f2d5">tests::test1</a></div><div class="ttdeci">void test1()</div><div class="ttdoc">A Test to check an simple case.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00075">array_left_rotation.cpp:75</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a1bfb8711f49e591eb168ccaa3df6fb86"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a1bfb8711f49e591eb168ccaa3df6fb86">tests::shift_right</a></div><div class="ttdeci">std::vector< int32_t > shift_right(const std::vector< int32_t > &array, size_t shift)</div><div class="ttdoc">Shifts the given vector to the right by the shift amount and returns a new vector with the result....</div><div class="ttdef"><b>Definition</b> <a href="#l00047">array_right_rotation.cpp:47</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a2b9769e44683dcb67fe1083ad91e134d"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a2b9769e44683dcb67fe1083ad91e134d">tests::test4</a></div><div class="ttdeci">void test4()</div><div class="ttdoc">A Test to check a very large input.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00120">array_left_rotation.cpp:120</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_a6109193567a5b7e36a27f2b4865fce20"><div class="ttname"><a href="../../d9/df4/namespacetests.html#a6109193567a5b7e36a27f2b4865fce20">tests::print</a></div><div class="ttdeci">void print(const std::vector< int32_t > &array)</div><div class="ttdoc">Prints the values of a vector sequentially, ending with a newline character.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00029">array_left_rotation.cpp:29</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_aa515639572647508b94986489aab6d76"><div class="ttname"><a href="../../d9/df4/namespacetests.html#aa515639572647508b94986489aab6d76">tests::test3</a></div><div class="ttdeci">void test3()</div><div class="ttdoc">A Test to check an invalid shift value.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00105">array_left_rotation.cpp:105</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_abdd77344d4af8fd56d14a5cabbf2f669"><div class="ttname"><a href="../../d9/df4/namespacetests.html#abdd77344d4af8fd56d14a5cabbf2f669">tests::test2</a></div><div class="ttdeci">void test2()</div><div class="ttdoc">A Test to check an empty vector.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00090">array_left_rotation.cpp:90</a></div></div>
|
||||
<div class="ttc" id="anamespacetests_html_af7b81d7a1534216af6a36a80135beb86"><div class="ttname"><a href="../../d9/df4/namespacetests.html#af7b81d7a1534216af6a36a80135beb86">tests::test5</a></div><div class="ttdeci">void test5()</div><div class="ttdoc">A Test to check a shift of zero.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d14/array__left__rotation_8cpp_source.html#l00143">array_left_rotation.cpp:143</a></div></div>
|
||||
@@ -258,7 +261,7 @@ $(function(){initNavTree('d6/d57/array__right__rotation_8cpp_source.html','../..
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d6/d57/array__right__rotation_8cpp.html">array_right_rotation.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: graph/travelling_salesman_problem.cpp Pages: 1 -->
|
||||
<svg width="382pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: graph/travelling_salesman_problem.cpp Pages: 1 -->
|
||||
<svg width="382pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Ordinary Differential Equations</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -592,7 +592,7 @@ y_n + \frac{1}{2}dx\,f\left(x_n,y_n\right)\right)\]
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/library_sort.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -225,7 +225,7 @@ $(function(){initNavTree('d6/d74/library__sort_8cpp_source.html','../../'); init
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><b>library_sort.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: kadane Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d6/d74/namespacekadane.html','../../'); initResizable(
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d74/namespacekadane.html">kadane</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/catalan_numbers.cpp Pages: 1 -->
|
||||
<svg width="388pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/catalan_numbers.cpp Pages: 1 -->
|
||||
<svg width="388pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/golden_search_extrema.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -240,8 +240,7 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Get the minima of a function in the given interval. To get the maxima, simply negate the function. The golden ratio used here is: </p>
|
||||
<p class="formulaDsp">
|
||||
\[
|
||||
k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
\[k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
@@ -265,8 +264,8 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="comment">// ensure that lim_a < lim_b</span></div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (lim_a > lim_b) {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> std::swap(lim_a, lim_b);</div>
|
||||
<div class="line"><span class="lineno"> 42</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::abs(lim_a - lim_b) <= <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 43</span> std::cerr << <span class="stringliteral">"Search range must be greater than "</span> << <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::abs(lim_a - lim_b) <= EPSILON) {</div>
|
||||
<div class="line"><span class="lineno"> 43</span> std::cerr << <span class="stringliteral">"Search range must be greater than "</span> << EPSILON << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <span class="keywordflow">return</span> lim_a;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> }</div>
|
||||
<div class="line"><span class="lineno"> 46</span> </div>
|
||||
@@ -290,13 +289,12 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div class="line"><span class="lineno"> 64</span> iters++;</div>
|
||||
<div class="line"><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// continue till the interval width is greater than sqrt(system epsilon)</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> } <span class="keywordflow">while</span> (std::abs(lim_a - lim_b) > <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><span class="lineno"> 67</span> } <span class="keywordflow">while</span> (std::abs(lim_a - lim_b) > EPSILON);</div>
|
||||
<div class="line"><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><span class="lineno"> 69</span> std::cout << <span class="stringliteral">" (iters: "</span> << iters << <span class="stringliteral">") "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> prev_mean;</div>
|
||||
<div class="line"><span class="lineno"> 71</span>}</div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a4251b4df4748a0b9c43a48f61bdd2397"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a4251b4df4748a0b9c43a48f61bdd2397">numerical_methods::simpson_method::f</a></div><div class="ttdeci">double f(double x)</div><div class="ttdoc">A function f(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00113">composite_simpson_rule.cpp:113</a></div></div>
|
||||
<div class="ttc" id="agolden__search__extrema_8cpp_html_a002b2f4894492820fe708b1b7e7c5e70"><div class="ttname"><a href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div><div class="ttdeci">#define EPSILON</div><div class="ttdoc">solution accuracy limit</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d7a/golden__search__extrema_8cpp_source.html#l00018">golden_search_extrema.cpp:18</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -320,7 +318,7 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 140</span> {</div>
|
||||
<div class="line"><span class="lineno"> 141</span> std::cout.precision(9);</div>
|
||||
<div class="line"><span class="lineno"> 142</span> </div>
|
||||
<div class="line"><span class="lineno"> 143</span> std::cout << <span class="stringliteral">"Computations performed with machine epsilon: "</span> << <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div>
|
||||
<div class="line"><span class="lineno"> 143</span> std::cout << <span class="stringliteral">"Computations performed with machine epsilon: "</span> << EPSILON</div>
|
||||
<div class="line"><span class="lineno"> 144</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 145</span> </div>
|
||||
<div class="line"><span class="lineno"> 146</span> <a class="code hl_function" href="#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>();</div>
|
||||
@@ -366,7 +364,7 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div class="line"><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><span class="lineno"> 89</span> std::cout << minima << <span class="stringliteral">"..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 90</span> </div>
|
||||
<div class="line"><span class="lineno"> 91</span> assert(std::abs(minima - 2) < <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><span class="lineno"> 91</span> assert(std::abs(minima - 2) < EPSILON);</div>
|
||||
<div class="line"><span class="lineno"> 92</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 93</span>}</div>
|
||||
<div class="ttc" id="agolden__search__extrema_8cpp_html_a1aa76a6d5fd4d333f9072beff1dc486b"><div class="ttname"><a href="#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a></div><div class="ttdeci">double get_minima(const std::function< double(double)> &f, double lim_a, double lim_b)</div><div class="ttdoc">Get the minima of a function in the given interval. To get the maxima, simply negate the function....</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d7a/golden__search__extrema_8cpp_source.html#l00030">golden_search_extrema.cpp:30</a></div></div>
|
||||
@@ -405,7 +403,7 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div class="line"><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><span class="lineno"> 112</span> std::cout << minima << <span class="stringliteral">" ("</span> << M_E << <span class="stringliteral">")..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><span class="lineno"> 114</span> assert(std::abs(minima - M_E) < <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><span class="lineno"> 114</span> assert(std::abs(minima - M_E) < EPSILON);</div>
|
||||
<div class="line"><span class="lineno"> 115</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 116</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
@@ -441,7 +439,7 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div class="line"><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><span class="lineno"> 133</span> std::cout << minima << <span class="stringliteral">" ("</span> << M_PI << <span class="stringliteral">")..."</span>;</div>
|
||||
<div class="line"><span class="lineno"> 134</span> </div>
|
||||
<div class="line"><span class="lineno"> 135</span> assert(std::abs(minima - M_PI) < <a class="code hl_define" href="#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><span class="lineno"> 135</span> assert(std::abs(minima - M_PI) < EPSILON);</div>
|
||||
<div class="line"><span class="lineno"> 136</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 137</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
@@ -453,7 +451,7 @@ k=\frac{3-\sqrt{5}}{2} \approx 0.381966\ldots\]
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d6/d7a/golden__search__extrema_8cpp.html">golden_search_extrema.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/golden_search_extrema.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,7 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="headertitle"><div class="title">golden_search_extrema.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d7a/golden__search__extrema_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d7a/golden__search__extrema_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#define _USE_MATH_DEFINES </span><span class="comment">//< required for MS Visual C++</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <cmath></span></div>
|
||||
@@ -134,7 +134,7 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <limits></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70"> 18</a></span><span class="preprocessor">#define EPSILON 1e-7 </span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span></div>
|
||||
<div class="foldopen" id="foldopen00030" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d6/d7a/golden__search__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b"> 30</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/d7a/golden__search__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a>(<span class="keyword">const</span> std::function<<span class="keywordtype">double</span>(<span class="keywordtype">double</span>)> &f, <span class="keywordtype">double</span> lim_a,</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">double</span> lim_b) {</div>
|
||||
@@ -148,8 +148,8 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// ensure that lim_a < lim_b</span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordflow">if</span> (lim_a > lim_b) {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> std::swap(lim_a, lim_b);</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::abs(lim_a - lim_b) <= <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>) {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::cerr << <span class="stringliteral">"Search range must be greater than "</span> << <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::abs(lim_a - lim_b) <= EPSILON) {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> std::cerr << <span class="stringliteral">"Search range must be greater than "</span> << EPSILON << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> lim_a;</div>
|
||||
<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> </div>
|
||||
@@ -173,13 +173,13 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> iters++;</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="comment">// continue till the interval width is greater than sqrt(system epsilon)</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> } <span class="keywordflow">while</span> (std::abs(lim_a - lim_b) > <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> } <span class="keywordflow">while</span> (std::abs(lim_a - lim_b) > EPSILON);</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> std::cout << <span class="stringliteral">" (iters: "</span> << iters << <span class="stringliteral">") "</span>;</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">return</span> prev_mean;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span></div>
|
||||
<div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="../../d6/d7a/golden__search__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0"> 79</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d7a/golden__search__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>() {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// define the function to minimize as a lambda function</span></div>
|
||||
@@ -193,11 +193,11 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::cout << minima << <span class="stringliteral">"..."</span>;</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> assert(std::abs(minima - 2) < <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> assert(std::abs(minima - 2) < EPSILON);</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span></div>
|
||||
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="../../d6/d7a/golden__search__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0"> 101</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d7a/golden__search__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a>() {</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// define the function to maximize as a lambda function</span></div>
|
||||
@@ -212,11 +212,11 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> std::cout << minima << <span class="stringliteral">" ("</span> << M_E << <span class="stringliteral">")..."</span>;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> assert(std::abs(minima - M_E) < <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> assert(std::abs(minima - M_E) < EPSILON);</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span></div>
|
||||
<div class="foldopen" id="foldopen00124" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="../../d6/d7a/golden__search__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e"> 124</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d7a/golden__search__extrema_8cpp.html#a6d0455dd5c30adda100e95f0423c786e">test3</a>() {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// define the function to maximize as a lambda function</span></div>
|
||||
@@ -229,16 +229,16 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> std::cout << minima << <span class="stringliteral">" ("</span> << M_PI << <span class="stringliteral">")..."</span>;</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> assert(std::abs(minima - M_PI) < <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a>);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> assert(std::abs(minima - M_PI) < EPSILON);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> std::cout << <span class="stringliteral">"passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span></div>
|
||||
<div class="foldopen" id="foldopen00140" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="../../d6/d7a/golden__search__extrema_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 140</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d7a/golden__search__extrema_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> std::cout.precision(9);</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> std::cout << <span class="stringliteral">"Computations performed with machine epsilon: "</span> << <a class="code hl_define" href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> std::cout << <span class="stringliteral">"Computations performed with machine epsilon: "</span> << EPSILON</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_function" href="../../d6/d7a/golden__search__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a>();</div>
|
||||
@@ -248,7 +248,6 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="agolden__search__extrema_8cpp_html_a002b2f4894492820fe708b1b7e7c5e70"><div class="ttname"><a href="../../d6/d7a/golden__search__extrema_8cpp.html#a002b2f4894492820fe708b1b7e7c5e70">EPSILON</a></div><div class="ttdeci">#define EPSILON</div><div class="ttdoc">solution accuracy limit</div><div class="ttdef"><b>Definition</b> <a href="#l00018">golden_search_extrema.cpp:18</a></div></div>
|
||||
<div class="ttc" id="agolden__search__extrema_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="../../d6/d7a/golden__search__extrema_8cpp.html#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdoc">Test function to find maxima for the function in the interval Expected result: .</div><div class="ttdef"><b>Definition</b> <a href="#l00101">golden_search_extrema.cpp:101</a></div></div>
|
||||
<div class="ttc" id="agolden__search__extrema_8cpp_html_a1440a7779ac56f47a3f355ce4a8c7da0"><div class="ttname"><a href="../../d6/d7a/golden__search__extrema_8cpp.html#a1440a7779ac56f47a3f355ce4a8c7da0">test1</a></div><div class="ttdeci">void test1()</div><div class="ttdoc">Test function to find minima for the function in the interval Expected result = 2.</div><div class="ttdef"><b>Definition</b> <a href="#l00079">golden_search_extrema.cpp:79</a></div></div>
|
||||
<div class="ttc" id="agolden__search__extrema_8cpp_html_a1aa76a6d5fd4d333f9072beff1dc486b"><div class="ttname"><a href="../../d6/d7a/golden__search__extrema_8cpp.html#a1aa76a6d5fd4d333f9072beff1dc486b">get_minima</a></div><div class="ttdeci">double get_minima(const std::function< double(double)> &f, double lim_a, double lim_b)</div><div class="ttdoc">Get the minima of a function in the given interval. To get the maxima, simply negate the function....</div><div class="ttdef"><b>Definition</b> <a href="#l00030">golden_search_extrema.cpp:30</a></div></div>
|
||||
@@ -260,7 +259,7 @@ $(function(){initNavTree('d6/d7a/golden__search__extrema_8cpp_source.html','../.
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d6/d7a/golden__search__extrema_8cpp.html">golden_search_extrema.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
302
d6/d7c/structtests_1_1_node.html
Normal file
@@ -0,0 +1,302 @@
|
||||
<!-- 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>
|
||||
<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.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: tests::Node Struct 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>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.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/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" 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! -->
|
||||
<div id="titlearea">
|
||||
<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">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @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&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(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&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('d6/d7c/structtests_1_1_node.html','../../'); initResizable(true); });
|
||||
/* @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">
|
||||
<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">
|
||||
<div class="summary">
|
||||
<a href="#pub-methods">Public Member Functions</a> |
|
||||
<a href="#pub-attribs">Public Attributes</a> |
|
||||
<a href="../../d0/dfa/structtests_1_1_node-members.html">List of all members</a> </div>
|
||||
<div class="headertitle"><div class="title">tests::Node Struct Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>A <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> struct that represents a single <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> in a Binary Tree.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for tests::Node:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dc/dce/structtests_1_1_node__coll__graph.svg" width="256" height="140"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<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:a005dc56b0c58350a13f4796b9b30b6c5" id="r_a005dc56b0c58350a13f4796b9b30b6c5"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a005dc56b0c58350a13f4796b9b30b6c5">Node</a> (int64_t _data)</td></tr>
|
||||
<tr class="memdesc:a005dc56b0c58350a13f4796b9b30b6c5"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> with some initial data. <br /></td></tr>
|
||||
<tr class="separator:a005dc56b0c58350a13f4796b9b30b6c5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a12a06eef5ccaf667f319506eee655d95" id="r_a12a06eef5ccaf667f319506eee655d95"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a12a06eef5ccaf667f319506eee655d95">Node</a> (int64_t _data, <a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html">Node</a> *_next)</td></tr>
|
||||
<tr class="memdesc:a12a06eef5ccaf667f319506eee655d95"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> with initial data and a successor. <br /></td></tr>
|
||||
<tr class="separator:a12a06eef5ccaf667f319506eee655d95"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
Public Attributes</h2></td></tr>
|
||||
<tr class="memitem:a7461292b8b91aed86404d0ab019dfdd1" id="r_a7461292b8b91aed86404d0ab019dfdd1"><td class="memItemLeft" align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a7461292b8b91aed86404d0ab019dfdd1">data</a></td></tr>
|
||||
<tr class="memdesc:a7461292b8b91aed86404d0ab019dfdd1"><td class="mdescLeft"> </td><td class="mdescRight">The value of the <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a>. <br /></td></tr>
|
||||
<tr class="separator:a7461292b8b91aed86404d0ab019dfdd1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a7c867b8e1034a6f5da490c8b8c09cb77" id="r_a7c867b8e1034a6f5da490c8b8c09cb77"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="#a7c867b8e1034a6f5da490c8b8c09cb77">next</a></td></tr>
|
||||
<tr class="memdesc:a7c867b8e1034a6f5da490c8b8c09cb77"><td class="mdescLeft"> </td><td class="mdescRight">The <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a>'s successor. <br /></td></tr>
|
||||
<tr class="separator:a7c867b8e1034a6f5da490c8b8c09cb77"><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 <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> struct that represents a single <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> in a Binary Tree. </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html#l00032">32</a> of file <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html">circular_linked_list.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
||||
<a id="a005dc56b0c58350a13f4796b9b30b6c5" name="a005dc56b0c58350a13f4796b9b30b6c5"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a005dc56b0c58350a13f4796b9b30b6c5">◆ </a></span>Node() <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">operations_on_datastructures::circular_linked_list::Node::Node </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>_data</em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Creates a new <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> with some initial data. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">_data</td><td>Value of <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>< Set value of <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> data</p>
|
||||
<p>< Initialize successor</p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html#l00039">39</a> of file <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html">circular_linked_list.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 39</span> {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <a class="code hl_variable" href="#a7461292b8b91aed86404d0ab019dfdd1">data</a> = _data; </div>
|
||||
<div class="line"><span class="lineno"> 41</span> <a class="code hl_variable" href="#a7c867b8e1034a6f5da490c8b8c09cb77">next</a> = <span class="keyword">nullptr</span>; </div>
|
||||
<div class="line"><span class="lineno"> 42</span> }</div>
|
||||
<div class="ttc" id="astructtests_1_1_node_html_a7461292b8b91aed86404d0ab019dfdd1"><div class="ttname"><a href="#a7461292b8b91aed86404d0ab019dfdd1">tests::Node::data</a></div><div class="ttdeci">int64_t data</div><div class="ttdoc">The value of the Node.</div><div class="ttdef"><b>Definition</b> <a href="../../de/d33/circular__linked__list_8cpp_source.html#l00033">circular_linked_list.cpp:33</a></div></div>
|
||||
<div class="ttc" id="astructtests_1_1_node_html_a7c867b8e1034a6f5da490c8b8c09cb77"><div class="ttname"><a href="#a7c867b8e1034a6f5da490c8b8c09cb77">tests::Node::next</a></div><div class="ttdeci">Node * next</div><div class="ttdoc">The Node's successor.</div><div class="ttdef"><b>Definition</b> <a href="../../de/d33/circular__linked__list_8cpp_source.html#l00034">circular_linked_list.cpp:34</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a12a06eef5ccaf667f319506eee655d95" name="a12a06eef5ccaf667f319506eee655d95"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a12a06eef5ccaf667f319506eee655d95">◆ </a></span>Node() <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">operations_on_datastructures::circular_linked_list::Node::Node </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>_data</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype"><a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html">Node</a> *</td> <td class="paramname"><span class="paramname"><em>_next</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Creates a new <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> with initial data and a successor. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">_data</td><td>Value of <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> </td></tr>
|
||||
<tr><td class="paramname">_next</td><td>Pointer to the next <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>< Set value of <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a> data</p>
|
||||
<p>< Initialize successor</p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html#l00048">48</a> of file <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html">circular_linked_list.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <a class="code hl_variable" href="#a7461292b8b91aed86404d0ab019dfdd1">data</a> = _data; </div>
|
||||
<div class="line"><span class="lineno"> 50</span> <a class="code hl_variable" href="#a7c867b8e1034a6f5da490c8b8c09cb77">next</a> = _next; </div>
|
||||
<div class="line"><span class="lineno"> 51</span> }</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="groupheader">Member Data Documentation</h2>
|
||||
<a id="a7461292b8b91aed86404d0ab019dfdd1" name="a7461292b8b91aed86404d0ab019dfdd1"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a7461292b8b91aed86404d0ab019dfdd1">◆ </a></span>data</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int64_t operations_on_datastructures::circular_linked_list::Node::data</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The value of the <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a>. </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html#l00033">33</a> of file <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html">circular_linked_list.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a7c867b8e1034a6f5da490c8b8c09cb77" name="a7c867b8e1034a6f5da490c8b8c09cb77"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a7c867b8e1034a6f5da490c8b8c09cb77">◆ </a></span>next</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html">Node</a>* operations_on_datastructures::circular_linked_list::Node::next</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The <a class="el" href="../../d6/d7c/structtests_1_1_node.html" title="A Node struct that represents a single Node in a Binary Tree.">Node</a>'s successor. </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html#l00034">34</a> of file <a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html">circular_linked_list.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li>operations_on_datastructures/<a class="el" href="../../de/d33/circular__linked__list_8cpp_source.html">circular_linked_list.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="../../d9/df4/namespacetests.html">tests</a></li><li class="navelem"><a class="el" href="../../d6/d7c/structtests_1_1_node.html">Node</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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
7
d6/d7c/structtests_1_1_node.js
Normal file
@@ -0,0 +1,7 @@
|
||||
var structtests_1_1_node =
|
||||
[
|
||||
[ "Node", "d6/d7c/structtests_1_1_node.html#a005dc56b0c58350a13f4796b9b30b6c5", null ],
|
||||
[ "Node", "d6/d7c/structtests_1_1_node.html#a12a06eef5ccaf667f319506eee655d95", null ],
|
||||
[ "data", "d6/d7c/structtests_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1", null ],
|
||||
[ "next", "d6/d7c/structtests_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing/double_hash_hash_table.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -148,6 +148,8 @@ Include dependency graph for double_hash_hash_table.cpp:</div>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/dde/structdouble__hashing_1_1_entry.html">double_hashing::Entry</a></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d3b/struct_entry.html">Entry</a></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
@@ -204,6 +206,10 @@ Variables</h2></td></tr>
|
||||
<tr class="separator:a5f5323b52037218cf5ae888778b7f980"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae5d042a7f6038a2ec9e5718d0c7fb31f" id="r_ae5d042a7f6038a2ec9e5718d0c7fb31f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d65/namespacedouble__hashing.html#ae5d042a7f6038a2ec9e5718d0c7fb31f">double_hashing::rehashing</a></td></tr>
|
||||
<tr class="separator:ae5d042a7f6038a2ec9e5718d0c7fb31f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0e2ff0f9cfc7b54e60a6561f792d8b26" id="r_a0e2ff0f9cfc7b54e60a6561f792d8b26"><td class="memItemLeft" align="right" valign="top">std::vector< <a class="el" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#a0e2ff0f9cfc7b54e60a6561f792d8b26">table</a></td></tr>
|
||||
<tr class="separator:a0e2ff0f9cfc7b54e60a6561f792d8b26"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a60a52265027518b25655d730f960013a" id="r_a60a52265027518b25655d730f960013a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#a60a52265027518b25655d730f960013a">totalSize</a></td></tr>
|
||||
<tr class="separator:a60a52265027518b25655d730f960013a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Storage mechanism using <a href="https://en.wikipedia.org/wiki/Double_hashing" target="_blank">double-hashed keys</a>. </p>
|
||||
@@ -286,7 +292,7 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 302</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 303</span>}</div>
|
||||
<div class="ttc" id="amd5_8cpp_html_a88705fab5f92adf3427b4cf76ff33edb"><div class="ttname"><a href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hashing::md5::hash</a></div><div class="ttdeci">void * hash(const std::string &message)</div><div class="ttdoc">Converts the string to bytestring and calls the main algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d96/md5_8cpp_source.html#l00288">md5.cpp:288</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a0d90726ed1de7b3d2ae261baed048003"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003">double_hashing::hashFxn</a></div><div class="ttdeci">size_t hashFxn(int key)</div><div class="ttdoc">Hash a key. Uses the STL library's std::hash() function.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00047">double_hash_hash_table.cpp:47</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a0d90726ed1de7b3d2ae261baed048003"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003">double_hashing::hashFxn</a></div><div class="ttdeci">size_t hashFxn(int key)</div><div class="ttdoc">Hash a key. Uses the STL library's std::hash() function.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00047">double_hash_hash_table.cpp:47</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a1e901418c759627557eff359b8db38cd"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd">double_hashing::display</a></div><div class="ttdeci">void display()</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00143">double_hash_hash_table.cpp:143</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a5d06e4598569526294f10104875f6824"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a5d06e4598569526294f10104875f6824">double_hashing::removalInfo</a></div><div class="ttdeci">void removalInfo(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00227">double_hash_hash_table.cpp:227</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a8f8ff4fb018e1bb32d67d8a1885d3200"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a8f8ff4fb018e1bb32d67d8a1885d3200">double_hashing::doubleHash</a></div><div class="ttdeci">int doubleHash(int key, bool searching)</div><div class="ttdoc">Performs double hashing to resolve collisions.</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00071">double_hash_hash_table.cpp:71</a></div></div>
|
||||
@@ -294,6 +300,39 @@ Variables</h2></td></tr>
|
||||
<div class="ttc" id="astructdouble__hashing_1_1_entry_html"><div class="ttname"><a href="../../d9/dde/structdouble__hashing_1_1_entry.html">double_hashing::Entry</a></div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00036">double_hash_hash_table.cpp:36</a></div></div>
|
||||
<div class="ttc" id="astructdouble__hashing_1_1_entry_html_ae114967c89dbba3b754dc4976bba3248"><div class="ttname"><a href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">double_hashing::Entry::key</a></div><div class="ttdeci">int key</div><div class="ttdoc">key value</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00038">double_hash_hash_table.cpp:38</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="groupheader">Variable Documentation</h2>
|
||||
<a id="a0e2ff0f9cfc7b54e60a6561f792d8b26" name="a0e2ff0f9cfc7b54e60a6561f792d8b26"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a0e2ff0f9cfc7b54e60a6561f792d8b26">◆ </a></span>table</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">std::vector<<a class="el" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a>> double_hashing::table</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00029">29</a> of file <a class="el" href="../../d6/d80/double__hash__hash__table_8cpp_source.html">double_hash_hash_table.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a60a52265027518b25655d730f960013a" name="a60a52265027518b25655d730f960013a"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a60a52265027518b25655d730f960013a">◆ </a></span>totalSize</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int double_hashing::totalSize</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00030">30</a> of file <a class="el" href="../../d6/d80/double__hash__hash__table_8cpp_source.html">double_hash_hash_table.cpp</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
@@ -302,7 +341,7 @@ Variables</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d6/d80/double__hash__hash__table_8cpp.html">double_hash_hash_table.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
var double__hash__hash__table_8cpp =
|
||||
[
|
||||
[ "double_hashing::Entry", "d9/dde/structdouble__hashing_1_1_entry.html", "d9/dde/structdouble__hashing_1_1_entry" ],
|
||||
[ "add", "d6/d80/double__hash__hash__table_8cpp.html#a79a9c914a6c68275b3640303d7faad8a", null ],
|
||||
[ "addInfo", "d6/d80/double__hash__hash__table_8cpp.html#a9c652b2e467e5d250dfe3bed83b12560", null ],
|
||||
[ "display", "d6/d80/double__hash__hash__table_8cpp.html#a1e901418c759627557eff359b8db38cd", null ],
|
||||
[ "doubleHash", "d6/d80/double__hash__hash__table_8cpp.html#a8f8ff4fb018e1bb32d67d8a1885d3200", null ],
|
||||
[ "hashFxn", "d6/d80/double__hash__hash__table_8cpp.html#a0d90726ed1de7b3d2ae261baed048003", null ],
|
||||
[ "Entry", "dd/d3b/struct_entry.html", "dd/d3b/struct_entry" ],
|
||||
[ "double_hashing::add", "d0/d65/namespacedouble__hashing.html#a79a9c914a6c68275b3640303d7faad8a", null ],
|
||||
[ "double_hashing::addInfo", "d0/d65/namespacedouble__hashing.html#a9c652b2e467e5d250dfe3bed83b12560", null ],
|
||||
[ "double_hashing::display", "d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd", null ],
|
||||
[ "double_hashing::doubleHash", "d0/d65/namespacedouble__hashing.html#a8f8ff4fb018e1bb32d67d8a1885d3200", null ],
|
||||
[ "double_hashing::hashFxn", "d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003", null ],
|
||||
[ "main", "d6/d80/double__hash__hash__table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "otherHashFxn", "d6/d80/double__hash__hash__table_8cpp.html#a33968a1178289ab61445dd4000df7082", null ],
|
||||
[ "putProber", "d6/d80/double__hash__hash__table_8cpp.html#ac2adfce49ac57f6dbd1778d2c1ce0d2b", null ],
|
||||
[ "rehash", "d6/d80/double__hash__hash__table_8cpp.html#af4981819aae8bc7e7beeaef02615e30d", null ],
|
||||
[ "removalInfo", "d6/d80/double__hash__hash__table_8cpp.html#a5d06e4598569526294f10104875f6824", null ],
|
||||
[ "remove", "d6/d80/double__hash__hash__table_8cpp.html#a28083ecac6eb94b643281875c8665931", null ],
|
||||
[ "searchingProber", "d6/d80/double__hash__hash__table_8cpp.html#a29f543e2626bad58907661e1e45028a6", null ]
|
||||
[ "double_hashing::otherHashFxn", "d0/d65/namespacedouble__hashing.html#a33968a1178289ab61445dd4000df7082", null ],
|
||||
[ "double_hashing::putProber", "d0/d65/namespacedouble__hashing.html#ac2adfce49ac57f6dbd1778d2c1ce0d2b", null ],
|
||||
[ "double_hashing::rehash", "d0/d65/namespacedouble__hashing.html#af4981819aae8bc7e7beeaef02615e30d", null ],
|
||||
[ "double_hashing::removalInfo", "d0/d65/namespacedouble__hashing.html#a5d06e4598569526294f10104875f6824", null ],
|
||||
[ "double_hashing::remove", "d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931", null ],
|
||||
[ "double_hashing::searchingProber", "d0/d65/namespacedouble__hashing.html#a29f543e2626bad58907661e1e45028a6", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing/double_hash_hash_table.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,11 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="headertitle"><div class="title">double_hash_hash_table.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d80/double__hash__hash__table_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d80/double__hash__hash__table_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <memory></span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/d65/namespacedouble__hashing.html">double_hashing</a> {</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// fwd declarations</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="keyword">using </span><a class="code hl_struct" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a> = <span class="keyword">struct </span><a class="code hl_struct" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a>;</div>
|
||||
@@ -143,28 +143,28 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keywordtype">int</span> tomb = -1;</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keywordtype">int</span> size;</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keywordtype">bool</span> rehashing;</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span></div>
|
||||
<div class="foldopen" id="foldopen00036" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d9/dde/structdouble__hashing_1_1_entry.html"> 36</a></span><span class="keyword">struct </span><a class="code hl_struct" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a> {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d9/dde/structdouble__hashing_1_1_entry.html"> 36</a></span><span class="keyword">struct </span><a class="code hl_function" href="../../d9/dde/structdouble__hashing_1_1_entry.html#a287b92112b6b43b34808a93778873475">Entry</a> {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../d9/dde/structdouble__hashing_1_1_entry.html#a287b92112b6b43b34808a93778873475"> 37</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../d9/dde/structdouble__hashing_1_1_entry.html#a287b92112b6b43b34808a93778873475">Entry</a>(<span class="keywordtype">int</span> <a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a> = notPresent) : <a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a>(<a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a>) {} </div>
|
||||
<div class="foldopen" id="foldopen00038" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248"> 38</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a>; </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span>};</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003"> 47</a></span><span class="keywordtype">size_t</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003">hashFxn</a>(<span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::hash<int> hash;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> hash(key);</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span></div>
|
||||
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a33968a1178289ab61445dd4000df7082"> 58</a></span><span class="keywordtype">size_t</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a33968a1178289ab61445dd4000df7082">otherHashFxn</a>(<span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> std::hash<int> hash;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">return</span> 1 + (7 - (hash(key) % 7));</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span></div>
|
||||
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a8f8ff4fb018e1bb32d67d8a1885d3200"> 71</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a8f8ff4fb018e1bb32d67d8a1885d3200">doubleHash</a>(<span class="keywordtype">int</span> key, <span class="keywordtype">bool</span> searching) {</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">int</span> hash = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003">hashFxn</a>(key));</div>
|
||||
@@ -209,7 +209,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">return</span> notPresent;</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span></div>
|
||||
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#ac2adfce49ac57f6dbd1778d2c1ce0d2b"> 120</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#ac2adfce49ac57f6dbd1778d2c1ce0d2b">putProber</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a>& entry, <span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (entry.<a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a> == notPresent || entry.<a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a> == tomb) {</div>
|
||||
@@ -218,7 +218,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span></div>
|
||||
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a29f543e2626bad58907661e1e45028a6"> 133</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a29f543e2626bad58907661e1e45028a6">searchingProber</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d9/dde/structdouble__hashing_1_1_entry.html">Entry</a>& entry, <span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (entry.<a class="code hl_variable" href="../../d9/dde/structdouble__hashing_1_1_entry.html#ae114967c89dbba3b754dc4976bba3248">key</a> == key) {</div>
|
||||
@@ -227,7 +227,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span></div>
|
||||
<div class="foldopen" id="foldopen00143" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd"> 143</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd">display</a>() {</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < totalSize; i++) {</div>
|
||||
@@ -244,7 +244,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span></div>
|
||||
<div class="foldopen" id="foldopen00161" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#af4981819aae8bc7e7beeaef02615e30d"> 161</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#af4981819aae8bc7e7beeaef02615e30d">rehash</a>() {</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="comment">// Necessary so wall of add info isn't printed all at once</span></div>
|
||||
@@ -267,7 +267,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> std::cout << <span class="stringliteral">"Table was rehashed, new size is: "</span> << totalSize << std::endl;</div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span></div>
|
||||
<div class="foldopen" id="foldopen00185" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a79a9c914a6c68275b3640303d7faad8a"> 185</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a79a9c914a6c68275b3640303d7faad8a">add</a>(<span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="comment">// auto* entry = new Entry();</span></div>
|
||||
@@ -280,7 +280,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> }</div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span></div>
|
||||
<div class="foldopen" id="foldopen00199" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931"> 199</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(<span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a8f8ff4fb018e1bb32d67d8a1885d3200">doubleHash</a>(key, <span class="keyword">true</span>);</div>
|
||||
@@ -292,7 +292,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> size--;</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> </div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span></div>
|
||||
<div class="foldopen" id="foldopen00212" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a9c652b2e467e5d250dfe3bed83b12560"> 212</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a9c652b2e467e5d250dfe3bed83b12560">addInfo</a>(<span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> std::cout << <span class="stringliteral">"Initial table: "</span>;</div>
|
||||
@@ -306,7 +306,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd">display</a>();</div>
|
||||
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> </div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span></div>
|
||||
<div class="foldopen" id="foldopen00227" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"><a class="line" href="../../d0/d65/namespacedouble__hashing.html#a5d06e4598569526294f10104875f6824"> 227</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a5d06e4598569526294f10104875f6824">removalInfo</a>(<span class="keywordtype">int</span> key) {</div>
|
||||
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> std::cout << <span class="stringliteral">"Initial table: "</span>;</div>
|
||||
@@ -321,10 +321,11 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span>} <span class="comment">// namespace double_hashing</span></div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> </div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span><span class="keyword">using </span><a class="code hl_struct" href="../../d9/dde/structdouble__hashing_1_1_entry.html">double_hashing::Entry</a>;</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span><span class="keyword">using </span>double_hashing::table;</div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span><span class="keyword">using </span>double_hashing::totalSize;</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> </div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span></div>
|
||||
<div class="foldopen" id="foldopen00250" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="../../d6/d80/double__hash__hash__table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 250</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d80/double__hash__hash__table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keywordtype">int</span> cmd = 0, hash = 0, key = 0;</div>
|
||||
@@ -385,7 +386,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
</div>
|
||||
<div class="ttc" id="adouble__hash__hash__table_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d6/d80/double__hash__hash__table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00250">double_hash_hash_table.cpp:250</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html">double_hashing</a></div><div class="ttdoc">An implementation of hash table using double hashing algorithm.</div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a0d90726ed1de7b3d2ae261baed048003"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003">double_hashing::hashFxn</a></div><div class="ttdeci">size_t hashFxn(int key)</div><div class="ttdoc">Hash a key. Uses the STL library's std::hash() function.</div><div class="ttdef"><b>Definition</b> <a href="#l00047">double_hash_hash_table.cpp:47</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a0d90726ed1de7b3d2ae261baed048003"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a0d90726ed1de7b3d2ae261baed048003">double_hashing::hashFxn</a></div><div class="ttdeci">size_t hashFxn(int key)</div><div class="ttdoc">Hash a key. Uses the STL library's std::hash() function.</div><div class="ttdef"><b>Definition</b> <a href="#l00047">double_hash_hash_table.cpp:47</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a1e901418c759627557eff359b8db38cd"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a1e901418c759627557eff359b8db38cd">double_hashing::display</a></div><div class="ttdeci">void display()</div><div class="ttdef"><b>Definition</b> <a href="#l00143">double_hash_hash_table.cpp:143</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a28083ecac6eb94b643281875c8665931"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">double_hashing::remove</a></div><div class="ttdeci">void remove(int key)</div><div class="ttdef"><b>Definition</b> <a href="#l00199">double_hash_hash_table.cpp:199</a></div></div>
|
||||
<div class="ttc" id="anamespacedouble__hashing_html_a29f543e2626bad58907661e1e45028a6"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a29f543e2626bad58907661e1e45028a6">double_hashing::searchingProber</a></div><div class="ttdeci">bool searchingProber(const Entry &entry, int key)</div><div class="ttdef"><b>Definition</b> <a href="#l00133">double_hash_hash_table.cpp:133</a></div></div>
|
||||
@@ -405,7 +406,7 @@ $(function(){initNavTree('d6/d80/double__hash__hash__table_8cpp_source.html','..
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d6/d80/double__hash__hash__table_8cpp.html">double_hash_hash_table.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: hashing::sha256::Hash Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -291,7 +291,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -315,7 +315,7 @@ Private Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d0c/namespacehashing.html">hashing</a></li><li class="navelem"><b>sha256</b></li><li class="navelem"><a class="el" href="../../d6/d84/classhashing_1_1sha256_1_1_hash.html">Hash</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: utils Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d6/d84/namespaceutils.html','../../'); initResizable(t
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d84/namespaceutils.html">utils</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: morse Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d6/d8d/namespacemorse.html','../../'); initResizable(t
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/d8d/namespacemorse.html">morse</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/large_number.h Pages: 1 -->
|
||||
<svg width="272pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/large_number.h Pages: 1 -->
|
||||
<svg width="272pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/large_factorial.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -248,8 +248,8 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 30</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 31</span> }</div>
|
||||
<div class="line"><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.num_digits();</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 33</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> N = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.num_digits();</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="keywordflow">if</span> (known_reslt[i] != <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.digit_char(i)) {</div>
|
||||
<div class="line"><span class="lineno"> 36</span> std::cerr << i << <span class="stringliteral">"^th digit mismatch! "</span> << known_reslt[i]</div>
|
||||
<div class="line"><span class="lineno"> 37</span> << <span class="stringliteral">" != "</span> << <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.digit_char(i) << std::endl;</div>
|
||||
@@ -260,7 +260,6 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 42</span> std::cout << <span class="stringliteral">"Passed!"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 44</span>}</div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -303,8 +302,8 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 71</span> }</div>
|
||||
<div class="line"><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.num_digits();</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> N = <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.num_digits();</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">for</span> (i = 0; i < N; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">if</span> (known_reslt[i] != <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.digit_char(i)) {</div>
|
||||
<div class="line"><span class="lineno"> 76</span> std::cerr << i << <span class="stringliteral">"^th digit mismatch! "</span> << known_reslt[i]</div>
|
||||
<div class="line"><span class="lineno"> 77</span> << <span class="stringliteral">" != "</span> << <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>.digit_char(i) << std::endl;</div>
|
||||
@@ -324,7 +323,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/d9d/large__factorial_8cpp.html">large_factorial.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/large_factorial.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,13 @@ $(function(){initNavTree('d6/d9d/large__factorial_8cpp_source.html','../../'); i
|
||||
<div class="headertitle"><div class="title">large_factorial.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/d9d/large__factorial_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/d9d/large__factorial_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <cstring></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <ctime></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include "<a class="code" href="../../d4/d86/large__number_8h.html">./large_number.h</a>"</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span></div>
|
||||
<div class="foldopen" id="foldopen00017" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="../../d6/d9d/large__factorial_8cpp.html#a3f93b60e229b6683e24c4754a7106ee8"> 17</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d6/d9d/large__factorial_8cpp.html#a3f93b60e229b6683e24c4754a7106ee8">test1</a>() {</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> std::cout << <span class="stringliteral">"---- Check 1\t"</span>;</div>
|
||||
@@ -161,7 +161,7 @@ $(function(){initNavTree('d6/d9d/large__factorial_8cpp_source.html','../../'); i
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
|
||||
<div class="foldopen" id="foldopen00054" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d6/d9d/large__factorial_8cpp.html#a76aae4778fbe89a3d59fd61fbc050cfa"> 54</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d6/d9d/large__factorial_8cpp.html#a76aae4778fbe89a3d59fd61fbc050cfa">test2</a>() {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> std::cout << <span class="stringliteral">"---- Check 2\t"</span>;</div>
|
||||
@@ -195,7 +195,7 @@ $(function(){initNavTree('d6/d9d/large__factorial_8cpp_source.html','../../'); i
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span></div>
|
||||
<div class="foldopen" id="foldopen00089" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="../../d6/d9d/large__factorial_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 89</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[]) {</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">int</span> number, i;</div>
|
||||
@@ -239,7 +239,7 @@ $(function(){initNavTree('d6/d9d/large__factorial_8cpp_source.html','../../'); i
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/d9d/large__factorial_8cpp.html">large_factorial.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: machine_learning::aystar_search::AyStarSearch< Puzzle >::Info Pages: 1 -->
|
||||
<svg width="137pt" height="116pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: machine_learning::aystar_search::AyStarSearch< Puzzle >::Info Pages: 1 -->
|
||||
<svg width="137pt" height="116pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: vigenere Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d6/da2/namespacevigenere.html','../../'); initResizabl
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/da2/namespacevigenere.html">vigenere</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/0_1_knapsack.cpp Pages: 1 -->
|
||||
<svg width="244pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/0_1_knapsack.cpp Pages: 1 -->
|
||||
<svg width="244pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/odd_even_sort.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -184,7 +184,7 @@ $(function(){initNavTree('d6/da9/odd__even__sort_8cpp_source.html','../../'); in
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><b>odd_even_sort.cpp</b></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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: tree_234 Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d6/dab/namespacetree__234.html','../../'); initResizab
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d6/dab/namespacetree__234.html">tree_234</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others::lru_cache::LRUCache Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -195,7 +195,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel explicit">explicit</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -233,7 +233,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -270,7 +270,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -302,7 +302,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -334,7 +334,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -394,7 +394,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -420,7 +420,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -449,7 +449,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -474,7 +474,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -500,7 +500,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -520,7 +520,7 @@ Private Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d0/d6f/namespaceothers.html">others</a></li><li class="navelem"><b>lru_cache</b></li><li class="navelem"><a class="el" href="../../d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html">LRUCache</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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/binomial_dist.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -437,7 +437,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d6/db0/binomial__dist_8cpp.html">binomial_dist.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: probability/binomial_dist.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,20 +124,20 @@ $(function(){initNavTree('d6/db0/binomial__dist_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">binomial_dist.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/db0/binomial__dist_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/db0/binomial__dist_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cmath></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#a4416a7bc7fa87201883c54cdc4c82813"> 22</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a>(<span class="keywordtype">double</span> n, <span class="keywordtype">double</span> p) { <span class="keywordflow">return</span> n * p; }</div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#acd4dd4558031e4c5d045c801f73d8861"> 29</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a>(<span class="keywordtype">double</span> n, <span class="keywordtype">double</span> p) { <span class="keywordflow">return</span> n * p * (1 - p); }</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span></div>
|
||||
<div class="foldopen" id="foldopen00036" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#af09e51f513cee647d41192ab0a872cdc"> 36</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#af09e51f513cee647d41192ab0a872cdc">binomial_standard_deviation</a>(<span class="keywordtype">double</span> n, <span class="keywordtype">double</span> p) {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">return</span> std::sqrt(<a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#acd4dd4558031e4c5d045c801f73d8861">binomial_variance</a>(n, p));</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#a78d36635232e54b5d71fcbf1eac9a49a"> 47</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a>(<span class="keywordtype">double</span> n, <span class="keywordtype">double</span> r) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">double</span> numerator = n;</div>
|
||||
@@ -154,13 +154,13 @@ $(function(){initNavTree('d6/db0/binomial__dist_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">return</span> numerator / denominator;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span></div>
|
||||
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#a19ae0a6a2bd200fd1eb0e31b2bf4cc76"> 65</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#a19ae0a6a2bd200fd1eb0e31b2bf4cc76">binomial_x_successes</a>(<span class="keywordtype">double</span> n, <span class="keywordtype">double</span> p, <span class="keywordtype">double</span> x) {</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#a78d36635232e54b5d71fcbf1eac9a49a">nCr</a>(n, x) * std::pow(p, x) * std::pow(1 - p, n - x);</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span></div>
|
||||
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#a76ed6ce71415fb400b65f0656cef3d25"> 74</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#a76ed6ce71415fb400b65f0656cef3d25">binomial_range_successes</a>(<span class="keywordtype">double</span> n, <span class="keywordtype">double</span> p, <span class="keywordtype">double</span> lower_bound,</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordtype">double</span> upper_bound) {</div>
|
||||
@@ -171,7 +171,7 @@ $(function(){initNavTree('d6/db0/binomial__dist_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> <a class="code hl_namespace" href="../../d4/ded/namespaceprobability.html">probability</a>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span></div>
|
||||
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="../../d6/db0/binomial__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 84</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::cout << <span class="stringliteral">"expected value : "</span> << <a class="code hl_function" href="../../d6/db0/binomial__dist_8cpp.html#a4416a7bc7fa87201883c54cdc4c82813">binomial_expected</a>(100, 0.5)</div>
|
||||
@@ -205,7 +205,7 @@ $(function(){initNavTree('d6/db0/binomial__dist_8cpp_source.html','../../'); ini
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d6/db0/binomial__dist_8cpp.html">binomial_dist.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/ode_semi_implicit_euler.cpp Pages: 1 -->
|
||||
<svg width="317pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: numerical_methods/ode_semi_implicit_euler.cpp Pages: 1 -->
|
||||
<svg width="317pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -140,7 +140,7 @@ $(function(){initNavTree('d4/d90/classdata__structures_1_1_skip_list.html','../.
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/inv_sqrt.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -144,11 +144,11 @@ Include dependency graph for inv_sqrt.cpp:</div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:ad219034bf5fba657f5035ec5a1d50f52" id="r_ad219034bf5fba657f5035ec5a1d50f52"><td class="memTemplParams" colspan="2">template<typename T = double, char iterations = 2> </td></tr>
|
||||
<tr class="memitem:ad219034bf5fba657f5035ec5a1d50f52" id="r_ad219034bf5fba657f5035ec5a1d50f52"><td class="memTemplParams" colspan="2">template<typename T = double, char iterations = 2> </td></tr>
|
||||
<tr class="memitem:ad219034bf5fba657f5035ec5a1d50f52"><td class="memTemplItemLeft" align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad219034bf5fba657f5035ec5a1d50f52">Fast_InvSqrt</a> (T x)</td></tr>
|
||||
<tr class="memdesc:ad219034bf5fba657f5035ec5a1d50f52"><td class="mdescLeft"> </td><td class="mdescRight">for <code>std::sqrt</code> <br /></td></tr>
|
||||
<tr class="separator:ad219034bf5fba657f5035ec5a1d50f52"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aa2703e5cf3fecde8becd9066b9666b97" id="r_aa2703e5cf3fecde8becd9066b9666b97"><td class="memTemplParams" colspan="2">template<typename T = double> </td></tr>
|
||||
<tr class="memitem:aa2703e5cf3fecde8becd9066b9666b97" id="r_aa2703e5cf3fecde8becd9066b9666b97"><td class="memTemplParams" colspan="2">template<typename T = double> </td></tr>
|
||||
<tr class="memitem:aa2703e5cf3fecde8becd9066b9666b97"><td class="memTemplItemLeft" align="right" valign="top">T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa2703e5cf3fecde8becd9066b9666b97">Standard_InvSqrt</a> (T number)</td></tr>
|
||||
<tr class="memdesc:aa2703e5cf3fecde8becd9066b9666b97"><td class="mdescLeft"> </td><td class="mdescRight">This is the function that calculates the fast inverse square root. The following code is the fast inverse square root with standard lib (cmath) More information can be found at <a href="https://www.linkedin.com/pulse/fast-inverse-square-root-still-armin-kassemi-langroodi" target="_blank">LinkedIn</a> <br /></td></tr>
|
||||
<tr class="separator:aa2703e5cf3fecde8becd9066b9666b97"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -171,7 +171,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T = double, char iterations = 2> </div>
|
||||
template<typename T = double, char iterations = 2> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -185,7 +185,7 @@ template<typename T = double, char iterations = 2> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -279,7 +279,7 @@ template<typename T = double, char iterations = 2> </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T = double> </div>
|
||||
template<typename T = double> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">T Standard_InvSqrt </td>
|
||||
@@ -331,7 +331,7 @@ template<typename T = double> </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -363,7 +363,7 @@ template<typename T = double> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/db8/inv__sqrt_8cpp.html">inv_sqrt.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: math/inv_sqrt.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d6/db8/inv__sqrt_8cpp_source.html','../../'); initResi
|
||||
<div class="headertitle"><div class="title">inv_sqrt.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/db8/inv__sqrt_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/db8/inv__sqrt_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
@@ -153,7 +154,7 @@ $(function(){initNavTree('d6/db8/inv__sqrt_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">return</span> y;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">template</span> <<span class="keyword">typename</span> T = <span class="keywordtype">double</span>></div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d6/db8/inv__sqrt_8cpp.html#aa2703e5cf3fecde8becd9066b9666b97"> 59</a></span>T <a class="code hl_function" href="../../d6/db8/inv__sqrt_8cpp.html#aa2703e5cf3fecde8becd9066b9666b97">Standard_InvSqrt</a>(T number) {</div>
|
||||
@@ -161,7 +162,7 @@ $(function(){initNavTree('d6/db8/inv__sqrt_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> 1.0f / squareRoot;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
||||
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../d6/db8/inv__sqrt_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 68</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/db8/inv__sqrt_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">const</span> <span class="keywordtype">float</span> epsilon = 1e-3f;</div>
|
||||
@@ -178,7 +179,7 @@ $(function(){initNavTree('d6/db8/inv__sqrt_8cpp_source.html','../../'); initResi
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> assert(std::fabs(<a class="code hl_function" href="../../d6/db8/inv__sqrt_8cpp.html#ad219034bf5fba657f5035ec5a1d50f52">Fast_InvSqrt<double></a>(5.0f) - 0.447141) < epsilon);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span></div>
|
||||
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="../../d6/db8/inv__sqrt_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 87</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/db8/inv__sqrt_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_function" href="../../d6/db8/inv__sqrt_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -208,7 +209,7 @@ $(function(){initNavTree('d6/db8/inv__sqrt_8cpp_source.html','../../'); initResi
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d6/db8/inv__sqrt_8cpp.html">inv_sqrt.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/jump_game.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -213,7 +213,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -241,7 +241,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d6/dba/jump__game_8cpp.html">jump_game.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var jump__game_8cpp =
|
||||
[
|
||||
[ "can_jump", "d6/dba/jump__game_8cpp.html#a33e3819aa9ffec0e380383c52603b502", null ],
|
||||
[ "greedy_algorithms::can_jump", "d2/d90/namespacegreedy__algorithms.html#a33e3819aa9ffec0e380383c52603b502", null ],
|
||||
[ "main", "d6/dba/jump__game_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/dba/jump__game_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,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.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/jump_game.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d6/dba/jump__game_8cpp_source.html','../../'); initRes
|
||||
<div class="headertitle"><div class="title">jump_game.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d6/dba/jump__game_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d6/dba/jump__game_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</a> {</div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d2/d90/namespacegreedy__algorithms.html#a33e3819aa9ffec0e380383c52603b502"> 42</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d2/d90/namespacegreedy__algorithms.html#a33e3819aa9ffec0e380383c52603b502">can_jump</a>(<span class="keyword">const</span> std::vector<int> &nums) {</div>
|
||||
@@ -142,7 +143,7 @@ $(function(){initNavTree('d6/dba/jump__game_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>} <span class="comment">// namespace greedy_algorithms</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../d6/dba/jump__game_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 57</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/dba/jump__game_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> assert(<a class="code hl_function" href="../../d2/d90/namespacegreedy__algorithms.html#a33e3819aa9ffec0e380383c52603b502">greedy_algorithms::can_jump</a>(std::vector<int>({4, 3, 1, 0, 5})));</div>
|
||||
@@ -154,7 +155,7 @@ $(function(){initNavTree('d6/dba/jump__game_8cpp_source.html','../../'); initRes
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> std::cout << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span></div>
|
||||
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="../../d6/dba/jump__game_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 71</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/dba/jump__game_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_function" href="../../d6/dba/jump__game_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -171,7 +172,7 @@ $(function(){initNavTree('d6/dba/jump__game_8cpp_source.html','../../'); initRes
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d6/dba/jump__game_8cpp.html">jump_game.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.12.0 </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.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: others/sparse_matrix.cpp Pages: 1 -->
|
||||
<svg width="134pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |