Documentation for c26eea874d

This commit is contained in:
realstealthninja
2025-05-19 11:38:33 +00:00
parent c7a9a42397
commit 14583a2f33
2829 changed files with 30266 additions and 21669 deletions

View File

@@ -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::sublist_search::Node Pages: 1 -->
<svg width="162pt" height="39pt"

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -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::sublist_search::Node Pages: 1 -->
<svg width="162pt" height="39pt"

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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/decimal_to_binary.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -258,7 +258,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_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../df/d06/decimal__to__binary_8cpp.html">decimal_to_binary.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>

View File

@@ -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/decimal_to_binary.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,9 +124,9 @@ $(function(){initNavTree('df/d06/decimal__to__binary_8cpp_source.html','../../')
<div class="headertitle"><div class="title">decimal_to_binary.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d06/decimal__to__binary_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="../../df/d06/decimal__to__binary_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 &lt;iostream&gt;</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="foldopen00011" data-start="{" data-end="}">
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="../../df/d06/decimal__to__binary_8cpp.html#a9240f2e79074a2a248395258aebbfa11"> 11</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d06/decimal__to__binary_8cpp.html#a9240f2e79074a2a248395258aebbfa11">method1</a>(<span class="keywordtype">int</span> number) {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordtype">int</span> remainder, binary = 0, var = 1;</div>
@@ -140,7 +140,7 @@ $(function(){initNavTree('df/d06/decimal__to__binary_8cpp_source.html','../../')
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Method 1 : &quot;</span> &lt;&lt; binary &lt;&lt; std::endl;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span>}</div>
</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</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="../../df/d06/decimal__to__binary_8cpp.html#a10df57491019f0ac39b492740fb388f7"> 27</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d06/decimal__to__binary_8cpp.html#a10df57491019f0ac39b492740fb388f7">method2</a>(<span class="keywordtype">int</span> number) {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">int</span> num_bits = 0;</div>
@@ -181,7 +181,7 @@ $(function(){initNavTree('df/d06/decimal__to__binary_8cpp_source.html','../../')
<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"><a class="el" href="../../df/d06/decimal__to__binary_8cpp.html">decimal_to_binary.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>

View File

@@ -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/fibonacci.cpp Pages: 1 -->
<svg width="191pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -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/fibonacci.cpp Pages: 1 -->
<svg width="191pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -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++: pancake_sort 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d10/namespacepancake__sort.html','../../'); initRes
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d10/namespacepancake__sort.html">pancake_sort</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>

View File

@@ -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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -137,7 +137,7 @@ $(function(){initNavTree('de/d9d/classdata__structures_1_1linked__list_1_1link.h
<!-- 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>

View File

@@ -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/midpoint_integral_method.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -339,7 +339,7 @@ Functions</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../df/d11/midpoint__integral__method_8cpp_source.html#l00162">162</a> of file <a class="el" href="../../df/d11/midpoint__integral__method_8cpp_source.html">midpoint_integral_method.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 162</span> {</div>
<div class="line"><span class="lineno"> 163</span> std::int32_t <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> =</div>
<div class="line"><span class="lineno"> 163</span> std::int32_t N =</div>
<div class="line"><span class="lineno"> 164</span> 16; </div>
<div class="line"><span class="lineno"> 166</span> <span class="keywordtype">double</span> a = 1, b = 3; </div>
<div class="line"><span class="lineno"> 168</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> = NAN; </div>
@@ -351,7 +351,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 174</span> <span class="comment">// Get user input (by the command line parameters or the console after</span></div>
<div class="line"><span class="lineno"> 175</span> <span class="comment">// displaying messages)</span></div>
<div class="line"><span class="lineno"> 176</span> <span class="keywordflow">if</span> (argc == 4) {</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = std::atoi(argv[1]);</div>
<div class="line"><span class="lineno"> 177</span> N = std::atoi(argv[1]);</div>
<div class="line"><span class="lineno"> 178</span> a = std::atof(argv[2]);</div>
<div class="line"><span class="lineno"> 179</span> b = std::atof(argv[3]);</div>
<div class="line"><span class="lineno"> 180</span> <span class="comment">// Check if a&lt;b else abort</span></div>
@@ -360,10 +360,10 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 183</span> <span class="keywordflow">if</span> (N &lt; 4 || a != 1 || b != 3) {</div>
<div class="line"><span class="lineno"> 184</span> used_argv_parameters = <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 185</span> }</div>
<div class="line"><span class="lineno"> 186</span> std::cout &lt;&lt; <span class="stringliteral">&quot;You selected N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 186</span> std::cout &lt;&lt; <span class="stringliteral">&quot;You selected N=&quot;</span> &lt;&lt; N &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 187</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 188</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 189</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Default N=&quot;</span> &lt;&lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 189</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Default N=&quot;</span> &lt;&lt; N &lt;&lt; <span class="stringliteral">&quot;, a=&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, b=&quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 190</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 191</span> }</div>
<div class="line"><span class="lineno"> 192</span> </div>
@@ -376,7 +376,6 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 199</span>}</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="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 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>
@@ -430,7 +429,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 58</span> <span class="comment">// Create the data table</span></div>
<div class="line"><span class="lineno"> 59</span> <span class="comment">// Loop from x0 to xN-1</span></div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">double</span> temp = NAN;</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i &lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) {</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i &lt; N; i++) {</div>
<div class="line"><span class="lineno"> 62</span> temp = func(xi + <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a> / 2); <span class="comment">// find f(xi+h/2)</span></div>
<div class="line"><span class="lineno"> 63</span> data_table.insert(</div>
<div class="line"><span class="lineno"> 64</span> std::pair&lt;std::int32_t, double&gt;(i, temp)); <span class="comment">// add i and f(xi)</span></div>
@@ -440,7 +439,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 68</span> <span class="comment">// Evaluate the integral.</span></div>
<div class="line"><span class="lineno"> 69</span> <span class="comment">// Remember: {f(x0+h/2) + f(x1+h/2) + ... + f(xN-1+h/2)}</span></div>
<div class="line"><span class="lineno"> 70</span> <span class="keywordtype">double</span> evaluate_integral = 0;</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i &lt; <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>; i++) evaluate_integral += data_table.at(i);</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">for</span> (std::int32_t i = 0; i &lt; N; i++) evaluate_integral += data_table.at(i);</div>
<div class="line"><span class="lineno"> 72</span> </div>
<div class="line"><span class="lineno"> 73</span> <span class="comment">// Multiply by the coefficient h</span></div>
<div class="line"><span class="lineno"> 74</span> evaluate_integral *= <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>;</div>
@@ -493,7 +492,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">
@@ -515,34 +514,38 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 125</span> <span class="comment">// Call midpoint() for each of the test functions f, g, k, l</span></div>
<div class="line"><span class="lineno"> 126</span> <span class="comment">// Assert with two decimal point precision</span></div>
<div class="line"><span class="lineno"> 127</span> <span class="keywordtype">double</span> result_f = <a class="code hl_function" href="#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><span class="lineno"> 128</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::f);</div>
<div class="line"><span class="lineno"> 128</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#a7ee8e824ef3e138a9a21883b26d97226">numerical_methods::midpoint_rule::f</a>);</div>
<div class="line"><span class="lineno"> 129</span> assert((used_argv_parameters || (result_f &gt;= 4.09 &amp;&amp; result_f &lt;= 4.10)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 130</span> <span class="stringliteral">&quot;The result of f(x) is wrong&quot;</span>);</div>
<div class="line"><span class="lineno"> 131</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral f(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 132</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_f &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 133</span> </div>
<div class="line"><span class="lineno"> 134</span> <span class="keywordtype">double</span> result_g = <a class="code hl_function" href="#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><span class="lineno"> 135</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::g);</div>
<div class="line"><span class="lineno"> 135</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#ae682ee71af44b1e9e884849cc6a6b040">numerical_methods::midpoint_rule::g</a>);</div>
<div class="line"><span class="lineno"> 136</span> assert((used_argv_parameters || (result_g &gt;= 0.27 &amp;&amp; result_g &lt;= 0.28)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 137</span> <span class="stringliteral">&quot;The result of g(x) is wrong&quot;</span>);</div>
<div class="line"><span class="lineno"> 138</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral g(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 139</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_g &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 140</span> </div>
<div class="line"><span class="lineno"> 141</span> <span class="keywordtype">double</span> result_k = <a class="code hl_function" href="#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><span class="lineno"> 142</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::k);</div>
<div class="line"><span class="lineno"> 142</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#ae9f66040f8e0ba73c1c741261c22a52a">numerical_methods::midpoint_rule::k</a>);</div>
<div class="line"><span class="lineno"> 143</span> assert((used_argv_parameters || (result_k &gt;= 9.06 &amp;&amp; result_k &lt;= 9.07)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 144</span> <span class="stringliteral">&quot;The result of k(x) is wrong&quot;</span>);</div>
<div class="line"><span class="lineno"> 145</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral k(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 146</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_k &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 147</span> </div>
<div class="line"><span class="lineno"> 148</span> <span class="keywordtype">double</span> result_l = <a class="code hl_function" href="#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><span class="lineno"> 149</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::l);</div>
<div class="line"><span class="lineno"> 149</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="#ad53616fb4fa6880ae876bcba53365c51">numerical_methods::midpoint_rule::l</a>);</div>
<div class="line"><span class="lineno"> 150</span> assert((used_argv_parameters || (result_l &gt;= 7.16 &amp;&amp; result_l &lt;= 7.17)) &amp;&amp;</div>
<div class="line"><span class="lineno"> 151</span> <span class="stringliteral">&quot;The result of l(x) is wrong&quot;</span>);</div>
<div class="line"><span class="lineno"> 152</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral l(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><span class="lineno"> 153</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_l &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 154</span>}</div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_a7072493d1f0f8a91b2a71d4cc456c09c"><div class="ttname"><a href="#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a></div><div class="ttdeci">double midpoint(const std::int32_t N, const double h, const double a, const std::function&lt; double(double)&gt; &amp;func)</div><div class="ttdoc">Main function for implementing the Midpoint Integral Method implementation.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d11/midpoint__integral__method_8cpp_source.html#l00052">midpoint_integral_method.cpp:52</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_a7ee8e824ef3e138a9a21883b26d97226"><div class="ttname"><a href="#a7ee8e824ef3e138a9a21883b26d97226">numerical_methods::midpoint_rule::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="../../df/d11/midpoint__integral__method_8cpp_source.html#l00090">midpoint_integral_method.cpp:90</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ad53616fb4fa6880ae876bcba53365c51"><div class="ttname"><a href="#ad53616fb4fa6880ae876bcba53365c51">numerical_methods::midpoint_rule::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">A function l(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d11/midpoint__integral__method_8cpp_source.html#l00109">midpoint_integral_method.cpp:109</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ae682ee71af44b1e9e884849cc6a6b040"><div class="ttname"><a href="#ae682ee71af44b1e9e884849cc6a6b040">numerical_methods::midpoint_rule::g</a></div><div class="ttdeci">double g(double x)</div><div class="ttdoc">A function g(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d11/midpoint__integral__method_8cpp_source.html#l00097">midpoint_integral_method.cpp:97</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ae9f66040f8e0ba73c1c741261c22a52a"><div class="ttname"><a href="#ae9f66040f8e0ba73c1c741261c22a52a">numerical_methods::midpoint_rule::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">A function k(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d11/midpoint__integral__method_8cpp_source.html#l00103">midpoint_integral_method.cpp:103</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -552,7 +555,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_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../df/d11/midpoint__integral__method_8cpp.html">midpoint_integral_method.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>

View File

@@ -1,10 +1,10 @@
var midpoint__integral__method_8cpp =
[
[ "f", "df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226", null ],
[ "g", "df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040", null ],
[ "k", "df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a", null ],
[ "l", "df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51", null ],
[ "numerical_methods::midpoint_rule::f", "df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226", null ],
[ "numerical_methods::midpoint_rule::g", "df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040", null ],
[ "numerical_methods::midpoint_rule::k", "df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a", null ],
[ "numerical_methods::midpoint_rule::l", "df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51", null ],
[ "main", "df/d11/midpoint__integral__method_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
[ "midpoint", "df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c", null ],
[ "numerical_methods::midpoint_rule::midpoint", "df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c", null ],
[ "test", "df/d11/midpoint__integral__method_8cpp.html#a2ae48a41e43dc6ab11b962742349646e", null ]
];

View File

@@ -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/midpoint_integral_method.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,7 +124,7 @@ $(function(){initNavTree('df/d11/midpoint__integral__method_8cpp_source.html','.
<div class="headertitle"><div class="title">midpoint_integral_method.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d11/midpoint__integral__method_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="../../df/d11/midpoint__integral__method_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="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;cmath&gt;</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include &lt;cstdint&gt;</span> </div>
@@ -132,7 +132,7 @@ $(function(){initNavTree('df/d11/midpoint__integral__method_8cpp_source.html','.
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include &lt;functional&gt;</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include &lt;map&gt;</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="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/daa/namespacemidpoint__rule.html">midpoint_rule</a> {</div>
<div class="foldopen" id="foldopen00052" data-start="{" data-end="}">
@@ -169,50 +169,50 @@ $(function(){initNavTree('df/d11/midpoint__integral__method_8cpp_source.html','.
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">return</span> evaluate_integral;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span>}</div>
</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226"> 90</a></span><span class="keywordtype">double</span> f(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::sqrt(x) + std::log(x); }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040"> 97</a></span><span class="keywordtype">double</span> g(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::exp(-x) * (4 - std::pow(x, 2)); }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a"> 103</a></span><span class="keywordtype">double</span> k(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::sqrt(2 * std::pow(x, 3) + 3); }</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51"> 109</a></span><span class="keywordtype">double</span> l(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> x + std::log(2 * x + 1); }</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226"> 90</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226">f</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::sqrt(x) + std::log(x); }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040"> 97</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040">g</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::exp(-x) * (4 - std::pow(x, 2)); }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a"> 103</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">k</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> std::sqrt(2 * std::pow(x, 3) + 3); }</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51"> 109</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51">l</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> x + std::log(2 * x + 1); }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>} <span class="comment">// namespace midpoint_rule</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>} <span class="comment">// namespace numerical_methods</span></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="foldopen00123" data-start="{" data-end="}">
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#a2ae48a41e43dc6ab11b962742349646e"> 123</a></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>(std::int32_t N, <span class="keywordtype">double</span> <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, <span class="keywordtype">double</span> a, <span class="keywordtype">double</span> b,</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordtype">bool</span> used_argv_parameters) {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// Call midpoint() for each of the test functions f, g, k, l</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// Assert with two decimal point precision</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordtype">double</span> result_f = numerical_methods::midpoint_rule::midpoint(</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::f);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordtype">double</span> result_f = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226">numerical_methods::midpoint_rule::f</a>);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> assert((used_argv_parameters || (result_f &gt;= 4.09 &amp;&amp; result_f &lt;= 4.10)) &amp;&amp;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="stringliteral">&quot;The result of f(x) is wrong&quot;</span>);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral f(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_f &lt;&lt; std::endl;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">double</span> result_g = numerical_methods::midpoint_rule::midpoint(</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::g);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">double</span> result_g = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040">numerical_methods::midpoint_rule::g</a>);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> assert((used_argv_parameters || (result_g &gt;= 0.27 &amp;&amp; result_g &lt;= 0.28)) &amp;&amp;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="stringliteral">&quot;The result of g(x) is wrong&quot;</span>);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral g(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_g &lt;&lt; std::endl;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordtype">double</span> result_k = numerical_methods::midpoint_rule::midpoint(</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::k);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordtype">double</span> result_k = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">numerical_methods::midpoint_rule::k</a>);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> assert((used_argv_parameters || (result_k &gt;= 9.06 &amp;&amp; result_k &lt;= 9.07)) &amp;&amp;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="stringliteral">&quot;The result of k(x) is wrong&quot;</span>);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral k(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_k &lt;&lt; std::endl;</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> <span class="keywordtype">double</span> result_l = numerical_methods::midpoint_rule::midpoint(</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, numerical_methods::midpoint_rule::l);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordtype">double</span> result_l = <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a>(</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> N, <a class="code hl_function" href="../../d1/df3/hash__search_8cpp.html#a566eaf0ffafd50bc61e644561fd27001">h</a>, a, <a class="code hl_function" href="../../df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51">numerical_methods::midpoint_rule::l</a>);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> assert((used_argv_parameters || (result_l &gt;= 7.16 &amp;&amp; result_l &lt;= 7.17)) &amp;&amp;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="stringliteral">&quot;The result of l(x) is wrong&quot;</span>);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> std::cout &lt;&lt; <span class="stringliteral">&quot;The result of integral l(x) on interval [&quot;</span> &lt;&lt; a &lt;&lt; <span class="stringliteral">&quot;, &quot;</span> &lt;&lt; b</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> &lt;&lt; <span class="stringliteral">&quot;] is equal to: &quot;</span> &lt;&lt; result_l &lt;&lt; std::endl;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span>}</div>
</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="foldopen00162" data-start="{" data-end="}">
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"><a class="line" href="../../df/d11/midpoint__integral__method_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627"> 162</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="l00163" name="l00163"></a><span class="lineno"> 163</span> std::int32_t N =</div>
@@ -255,6 +255,10 @@ $(function(){initNavTree('df/d11/midpoint__integral__method_8cpp_source.html','.
<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 class="ttc" id="amidpoint__integral__method_8cpp_html_a7072493d1f0f8a91b2a71d4cc456c09c"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#a7072493d1f0f8a91b2a71d4cc456c09c">numerical_methods::midpoint_rule::midpoint</a></div><div class="ttdeci">double midpoint(const std::int32_t N, const double h, const double a, const std::function&lt; double(double)&gt; &amp;func)</div><div class="ttdoc">Main function for implementing the Midpoint Integral Method implementation.</div><div class="ttdef"><b>Definition</b> <a href="#l00052">midpoint_integral_method.cpp:52</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_a7ee8e824ef3e138a9a21883b26d97226"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#a7ee8e824ef3e138a9a21883b26d97226">numerical_methods::midpoint_rule::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="#l00090">midpoint_integral_method.cpp:90</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ad53616fb4fa6880ae876bcba53365c51"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#ad53616fb4fa6880ae876bcba53365c51">numerical_methods::midpoint_rule::l</a></div><div class="ttdeci">double l(double x)</div><div class="ttdoc">A function l(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="#l00109">midpoint_integral_method.cpp:109</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ae682ee71af44b1e9e884849cc6a6b040"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#ae682ee71af44b1e9e884849cc6a6b040">numerical_methods::midpoint_rule::g</a></div><div class="ttdeci">double g(double x)</div><div class="ttdoc">A function g(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="#l00097">midpoint_integral_method.cpp:97</a></div></div>
<div class="ttc" id="amidpoint__integral__method_8cpp_html_ae9f66040f8e0ba73c1c741261c22a52a"><div class="ttname"><a href="../../df/d11/midpoint__integral__method_8cpp.html#ae9f66040f8e0ba73c1c741261c22a52a">numerical_methods::midpoint_rule::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">A function k(x) that will be used to test the method.</div><div class="ttdef"><b>Definition</b> <a href="#l00103">midpoint_integral_method.cpp:103</a></div></div>
<div class="ttc" id="anamespacemidpoint__rule_html"><div class="ttname"><a href="../../d9/daa/namespacemidpoint__rule.html">midpoint_rule</a></div><div class="ttdoc">Functions for the Midpoint Integral method implementation.</div></div>
<div class="ttc" id="anamespacenumerical__methods_html"><div class="ttname"><a href="../../d1/de0/namespacenumerical__methods.html">numerical_methods</a></div><div class="ttdoc">for assert</div></div>
</div><!-- fragment --></div><!-- contents -->
@@ -263,7 +267,7 @@ $(function(){initNavTree('df/d11/midpoint__integral__method_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="../../df/d11/midpoint__integral__method_8cpp.html">midpoint_integral_method.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>

View File

@@ -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/bellman_ford.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -132,7 +132,7 @@ $(function(){initNavTree('df/d14/bellman__ford_8cpp_source.html','../../'); init
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// Wrapper class for storing an edge</span></div>
<div class="foldopen" id="foldopen00008" data-start="{" data-end="};">
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"><a class="line" href="../../d7/d77/class_edge.html"> 8</a></span><span class="keyword">class </span><a class="code hl_struct" href="../../d7/d77/class_edge.html">Edge</a> {</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"><a class="line" href="../../d7/d77/class_edge.html"> 8</a></span><span class="keyword">class </span>Edge {</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> <span class="keywordtype">int</span> src, dst, weight;</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span>};</div>
@@ -140,13 +140,13 @@ $(function(){initNavTree('df/d14/bellman__ford_8cpp_source.html','../../'); init
<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="comment">// Wrapper class for storing a graph</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="../../da/d9a/class_graph.html"> 14</a></span><span class="keyword">class </span><a class="code hl_class" href="../../da/d9a/class_graph.html">Graph</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="../../da/d9a/class_graph.html"> 14</a></span><span class="keyword">class </span>Graph {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">int</span> vertexNum, edgeNum;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> std::vector&lt;Edge&gt; edges;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// Constructs a graph with V vertices and E edges</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_class" href="../../da/d9a/class_graph.html">Graph</a>(<span class="keywordtype">int</span> V, <span class="keywordtype">int</span> E) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> Graph(<span class="keywordtype">int</span> V, <span class="keywordtype">int</span> E) {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> this-&gt;vertexNum = V;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> this-&gt;edgeNum = E;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> this-&gt;edges.reserve(E);</div>
@@ -257,7 +257,7 @@ $(function(){initNavTree('df/d14/bellman__ford_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"><b>bellman_ford.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>

View File

@@ -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/dnf_sort.cpp Pages: 1 -->
<svg width="325pt" height="83pt"

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -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/dnf_sort.cpp Pages: 1 -->
<svg width="325pt" height="83pt"

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -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++: stack_using_queue 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d1c/namespacestack__using__queue.html','../../'); i
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d1c/namespacestack__using__queue.html">stack_using_queue</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>

View File

@@ -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/subset_sum_dynamic.cpp Pages: 1 -->
<svg width="290pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -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/subset_sum_dynamic.cpp Pages: 1 -->
<svg width="290pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -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/dsu_union_rank.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -216,7 +216,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
</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">
@@ -271,7 +271,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
</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 @@ element). Disjoint sets uses cases : for finding connected components in a graph
<div class="line"><span class="lineno"> 167</span> d.unionSet(5, 7);</div>
<div class="line"><span class="lineno"> 168</span> d.unionSet(9, 10);</div>
<div class="line"><span class="lineno"> 169</span> d.unionSet(2, 10);</div>
<div class="line"><span class="lineno"> 170</span> </div>
<div class="line"><span class="lineno"> 170</span></div>
<div class="line"><span class="lineno"> 172</span> vector&lt;uint64_t&gt; ans = {2, 1, 10};</div>
<div class="line"><span class="lineno"> 173</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; ans.size(); i++) {</div>
<div class="line"><span class="lineno"> 174</span> assert(d.getParents(2).at(i) ==</div>
@@ -314,7 +314,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
<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="../../df/d28/dsu__union__rank_8cpp.html">dsu_union_rank.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>

View File

@@ -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/dsu_union_rank.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,7 +124,8 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="headertitle"><div class="title">dsu_union_rank.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d28/dsu__union__rank_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="../../df/d28/dsu__union__rank_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="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
@@ -133,7 +134,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">using </span>std::cout;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">using </span>std::endl;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">using </span>std::vector;</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="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword">class </span><a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> vector&lt;uint64_t&gt; <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>; </div>
@@ -152,6 +153,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<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="foldopen" id="foldopen00062" data-start="{" data-end="}">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c"> 62</a></span> uint64_t <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(uint64_t i) {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordflow">while</span> (i != <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i]) {</div>
@@ -160,6 +162,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">return</span> i;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> }</div>
</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span></div>
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f"> 76</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f">unionSet</a>(uint64_t i, uint64_t j) {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a>(i, j)) {</div>
@@ -167,18 +170,19 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> uint64_t x = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> uint64_t y = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] &gt; <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> std::swap(x, y);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[x] = y;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] == <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]++;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[y] += <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[x];</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span></div>
<div class="foldopen" id="foldopen00108" data-start="{" data-end="}">
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303"> 108</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a>(uint64_t i, uint64_t j) {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i) == <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j)) {</div>
@@ -187,6 +191,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> }</div>
</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</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="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280"> 120</a></span> vector&lt;uint64_t&gt; <a class="code hl_function" href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280">getParents</a>(uint64_t i) {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> vector&lt;uint64_t&gt; ans;</div>
@@ -221,6 +226,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> cout &lt;&lt; <span class="stringliteral">&quot;1st test passed!&quot;</span> &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span>}</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span></div>
<div class="foldopen" id="foldopen00158" data-start="{" data-end="}">
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"><a class="line" href="../../df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae"> 158</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d28/dsu__union__rank_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>() {</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="comment">// checks the parents in the resultant structures</span></div>
@@ -234,7 +240,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> d.<a class="code hl_function" href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f">unionSet</a>(5, 7);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> d.<a class="code hl_function" href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f">unionSet</a>(9, 10);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> d.<a class="code hl_function" href="../../dd/d1f/classdsu.html#a81897528bdb53fd5e796d75d7dbc430f">unionSet</a>(2, 10);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> vector&lt;uint64_t&gt; ans = {2, 1, 10};</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; ans.size(); i++) {</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> assert(d.<a class="code hl_function" href="../../dd/d1f/classdsu.html#ab8ee27083a3c2e2df80755165a2ec280">getParents</a>(2).at(i) ==</div>
@@ -243,6 +249,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_8cpp_source.html','../../'); i
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> cout &lt;&lt; <span class="stringliteral">&quot;2nd test passed!&quot;</span> &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</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="foldopen" id="foldopen00183" data-start="{" data-end="}">
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="../../df/d28/dsu__union__rank_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 183</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d28/dsu__union__rank_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="../../df/d28/dsu__union__rank_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>(); <span class="comment">// run 1st test case</span></div>
@@ -270,7 +277,7 @@ $(function(){initNavTree('df/d28/dsu__union__rank_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_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../df/d28/dsu__union__rank_8cpp.html">dsu_union_rank.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>

View File

@@ -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: greedy_algorithms/kruskals_minimum_spanning_tree.cpp Pages: 1 -->
<svg width="238pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -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: greedy_algorithms/kruskals_minimum_spanning_tree.cpp Pages: 1 -->
<svg width="238pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -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.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -243,7 +243,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">
@@ -324,7 +324,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">
@@ -382,7 +382,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">
@@ -431,7 +431,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_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html">elliptic_curve_key_exchange.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>

View File

@@ -1,11 +1,11 @@
var elliptic__curve__key__exchange_8cpp =
[
[ "ciphers::elliptic_curve_key_exchange::Point", "d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html", "d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point" ],
[ "Point", "df/d2c/elliptic__curve__key__exchange_8cpp.html#af0a6e3521629c25c2b5d620f26429830", null ],
[ "addition", "df/d2c/elliptic__curve__key__exchange_8cpp.html#acc5fe9c2032fb7582c38a20d1fa69bcf", null ],
[ "exp", "df/d2c/elliptic__curve__key__exchange_8cpp.html#ac00616a4e40d3cd5cfb4da87d9ff9af0", null ],
[ "ciphers::elliptic_curve_key_exchange::Point", "df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#af0a6e3521629c25c2b5d620f26429830", null ],
[ "ciphers::elliptic_curve_key_exchange::addition", "df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#acc5fe9c2032fb7582c38a20d1fa69bcf", null ],
[ "ciphers::elliptic_curve_key_exchange::exp", "df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#ac00616a4e40d3cd5cfb4da87d9ff9af0", null ],
[ "main", "df/d2c/elliptic__curve__key__exchange_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "multiply", "df/d2c/elliptic__curve__key__exchange_8cpp.html#a17f3d667241b88115a95282cdd719cb2", null ],
[ "ciphers::elliptic_curve_key_exchange::multiply", "df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2", null ],
[ "test", "df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
[ "uint128_t_tests", "df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4", null ],
[ "uint256_t_tests", "df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae", null ]

View File

@@ -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.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,31 +124,31 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="headertitle"><div class="title">elliptic_curve_key_exchange.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d2c/elliptic__curve__key__exchange_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="../../df/d2c/elliptic__curve__key__exchange_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><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include &quot;<a class="code" href="../../da/da3/uint256__t_8hpp.html">uint256_t.hpp</a>&quot;</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="../../d6/d4e/namespaceciphers.html">ciphers</a> {</div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html"> 40</a></span><span class="keyword">namespace </span>elliptic_curve_key_exchange {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html"> 40</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html">elliptic_curve_key_exchange</a> {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span></div>
<div class="foldopen" id="foldopen00046" data-start="{" data-end="};">
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html"> 46</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> x, y; </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="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html#a5084e9ca27837662c31d4dc003815446"> 55</a></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html#a5084e9ca27837662c31d4dc003815446">operator==</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> &amp;p) { <span class="keywordflow">return</span> x == p.x &amp;&amp; y == p.y; }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
<div class="foldopen" id="foldopen00063" data-start="{" data-end="};">
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span></div>
<div class="foldopen" id="foldopen00063" data-start="{" data-end="}">
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html#af2142b27241b28f835e8ce78d7d6463c"> 63</a></span> <span class="keyword">friend</span> std::ostream &amp;<a class="code hl_friend" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html#af2142b27241b28f835e8ce78d7d6463c">operator&lt;&lt;</a>(std::ostream &amp;op, <span class="keyword">const</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> &amp;p) {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> op &lt;&lt; p.x &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; p.y;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> op;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#af0a6e3521629c25c2b5d620f26429830"> 67</a></span>} <a class="code hl_typedef" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#af0a6e3521629c25c2b5d620f26429830">Point</a>;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#af0a6e3521629c25c2b5d620f26429830"> 67</a></span>} <a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>;</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="foldopen00078" data-start="{" data-end="}">
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#ac00616a4e40d3cd5cfb4da87d9ff9af0"> 78</a></span><a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#ac00616a4e40d3cd5cfb4da87d9ff9af0">exp</a>(<a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> number, <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> <a class="code hl_function" href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a>, <span class="keyword">const</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> &amp;mod) {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a>) {</div>
@@ -168,7 +168,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">return</span> ans;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span>}</div>
</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span></div>
<div class="foldopen" id="foldopen00110" data-start="{" data-end="}">
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#acc5fe9c2032fb7582c38a20d1fa69bcf"> 110</a></span><a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#acc5fe9c2032fb7582c38a20d1fa69bcf">addition</a>(<a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> a, <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> b, <span class="keyword">const</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> &amp;curve_a_coeff,</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> mod) {</div>
@@ -204,7 +204,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">return</span> c;</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span>}</div>
</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span></div>
<div class="foldopen" id="foldopen00165" data-start="{" data-end="}">
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2"> 165</a></span><a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> <a class="code hl_function" href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">multiply</a>(<span class="keyword">const</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> &amp;a, <span class="keyword">const</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> &amp;curve_a_coeff, <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> p,</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keyword">const</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> &amp;mod) {</div>
@@ -234,7 +234,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span>} <span class="comment">// namespace elliptic_curve_key_exchange</span></div>
</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span>} <span class="comment">// namespace ciphers</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> </div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span></div>
<div class="foldopen" id="foldopen00197" data-start="{" data-end="}">
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"><a class="line" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4"> 197</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4">uint128_t_tests</a>() {</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="comment">// 1st test: Operations test</span></div>
@@ -264,7 +264,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> assert((a &lt;&lt; 64) == <a class="code hl_class" href="../../db/d9a/classuint128__t.html">uint128_t</a>(<span class="stringliteral">&quot;227290107637132170748078080907806769152&quot;</span>));</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span>}</div>
</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span></div>
<div class="foldopen" id="foldopen00230" data-start="{" data-end="}">
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"><a class="line" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae"> 230</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a37775d1724ffe404c088dabbc8da91ae">uint256_t_tests</a>() {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="comment">// 1st test: Operations test</span></div>
@@ -298,7 +298,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <span class="stringliteral">&quot;376561852756163540549632&quot;</span>));</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span>}</div>
</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> </div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span></div>
<div class="foldopen" id="foldopen00267" data-start="{" data-end="}">
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"><a class="line" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 267</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="comment">// demonstration of key exchange using curve secp112r1</span></div>
@@ -349,7 +349,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> assert(alice_shared_key == bob_shared_key);</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span>}</div>
</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> </div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span></div>
<div class="foldopen" id="foldopen00320" data-start="{" data-end="}">
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"><a class="line" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 320</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <a class="code hl_function" href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4">uint128_t_tests</a>(); <span class="comment">// running predefined 128-bit unsigned integer tests</span></div>
@@ -364,13 +364,14 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<div class="ttc" id="aelliptic__curve__key__exchange_8cpp_html_a8800c8a84d77dadadb05ad5e83b77ef4"><div class="ttname"><a href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#a8800c8a84d77dadadb05ad5e83b77ef4">uint128_t_tests</a></div><div class="ttdeci">static void uint128_t_tests()</div><div class="ttdoc">Function to test the uint128_t header.</div><div class="ttdef"><b>Definition</b> <a href="#l00197">elliptic_curve_key_exchange.cpp:197</a></div></div>
<div class="ttc" id="aelliptic__curve__key__exchange_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d2c/elliptic__curve__key__exchange_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Function to test the provided algorithm above.</div><div class="ttdef"><b>Definition</b> <a href="#l00267">elliptic_curve_key_exchange.cpp:267</a></div></div>
<div class="ttc" id="aelliptic__curve__key__exchange_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/d2c/elliptic__curve__key__exchange_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="#l00320">elliptic_curve_key_exchange.cpp:320</a></div></div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html"><div class="ttname"><a href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html">ciphers::elliptic_curve_key_exchange</a></div><div class="ttdoc">namespace elliptic_curve_key_exchange</div><div class="ttdef"><b>Definition</b> <a href="#l00040">elliptic_curve_key_exchange.cpp:40</a></div></div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html_a17f3d667241b88115a95282cdd719cb2"><div class="ttname"><a href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#a17f3d667241b88115a95282cdd719cb2">ciphers::elliptic_curve_key_exchange::multiply</a></div><div class="ttdeci">Point multiply(const Point &amp;a, const uint256_t &amp;curve_a_coeff, uint256_t p, const uint256_t &amp;mod)</div><div class="ttdoc">multiply Point and integer</div><div class="ttdef"><b>Definition</b> <a href="#l00165">elliptic_curve_key_exchange.cpp:165</a></div></div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html_ac00616a4e40d3cd5cfb4da87d9ff9af0"><div class="ttname"><a href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#ac00616a4e40d3cd5cfb4da87d9ff9af0">ciphers::elliptic_curve_key_exchange::exp</a></div><div class="ttdeci">uint256_t exp(uint256_t number, uint256_t power, const uint256_t &amp;mod)</div><div class="ttdoc">This function calculates number raised to exponent power under modulo mod using Modular Exponentiatio...</div><div class="ttdef"><b>Definition</b> <a href="#l00078">elliptic_curve_key_exchange.cpp:78</a></div></div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html_acc5fe9c2032fb7582c38a20d1fa69bcf"><div class="ttname"><a href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#acc5fe9c2032fb7582c38a20d1fa69bcf">ciphers::elliptic_curve_key_exchange::addition</a></div><div class="ttdeci">Point addition(Point a, Point b, const uint256_t &amp;curve_a_coeff, uint256_t mod)</div><div class="ttdoc">Addition of points.</div><div class="ttdef"><b>Definition</b> <a href="#l00110">elliptic_curve_key_exchange.cpp:110</a></div></div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html_af0a6e3521629c25c2b5d620f26429830"><div class="ttname"><a href="../../df/d6b/namespaceciphers_1_1elliptic__curve__key__exchange.html#af0a6e3521629c25c2b5d620f26429830">ciphers::elliptic_curve_key_exchange::Point</a></div><div class="ttdeci">struct ciphers::elliptic_curve_key_exchange::Point Point</div><div class="ttdoc">Definition of struct Point.</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="apower__for__huge__numbers_8cpp_html_aa141a7904f0c4668bac112d652a3acf9"><div class="ttname"><a href="../../df/def/power__for__huge__numbers_8cpp.html#aa141a7904f0c4668bac112d652a3acf9">multiply</a></div><div class="ttdeci">int multiply(int x, int res[], int res_size)</div><div class="ttdef"><b>Definition</b> <a href="../../df/def/power__for__huge__numbers_8cpp_source.html#l00025">power_for_huge_numbers.cpp:25</a></div></div>
<div class="ttc" id="apower__for__huge__numbers_8cpp_html_ae249a2af508aa94266023ce8aa81426f"><div class="ttname"><a href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a></div><div class="ttdeci">void power(int x, int n)</div><div class="ttdef"><b>Definition</b> <a href="../../df/def/power__for__huge__numbers_8cpp_source.html#l00056">power_for_huge_numbers.cpp:56</a></div></div>
<div class="ttc" id="astruct_point_html"><div class="ttname"><a href="../../d8/dc8/struct_point.html">Point</a></div><div class="ttdef"><b>Definition</b> <a href="../../d8/d6c/line__segment__intersection_8cpp_source.html#l00012">line_segment_intersection.cpp:12</a></div></div>
<div class="ttc" id="astructciphers_1_1elliptic__curve__key__exchange_1_1_point_html"><div class="ttname"><a href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a></div><div class="ttdoc">Definition of struct Point.</div><div class="ttdef"><b>Definition</b> <a href="#l00046">elliptic_curve_key_exchange.cpp:46</a></div></div>
<div class="ttc" id="astructciphers_1_1elliptic__curve__key__exchange_1_1_point_html_a5084e9ca27837662c31d4dc003815446"><div class="ttname"><a href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html#a5084e9ca27837662c31d4dc003815446">ciphers::elliptic_curve_key_exchange::Point::operator==</a></div><div class="ttdeci">bool operator==(const Point &amp;p)</div><div class="ttdoc">x and y co-ordinates</div><div class="ttdef"><b>Definition</b> <a href="#l00055">elliptic_curve_key_exchange.cpp:55</a></div></div>
<div class="ttc" id="astructciphers_1_1elliptic__curve__key__exchange_1_1_point_html_af2142b27241b28f835e8ce78d7d6463c"><div class="ttname"><a href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html#af2142b27241b28f835e8ce78d7d6463c">ciphers::elliptic_curve_key_exchange::Point::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;op, const Point &amp;p)</div><div class="ttdoc">ostream operator for printing Point</div><div class="ttdef"><b>Definition</b> <a href="#l00063">elliptic_curve_key_exchange.cpp:63</a></div></div>
@@ -381,7 +382,7 @@ $(function(){initNavTree('df/d2c/elliptic__curve__key__exchange_8cpp_source.html
<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="../../df/d2c/elliptic__curve__key__exchange_8cpp.html">elliptic_curve_key_exchange.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>

View File

@@ -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: probability/geometric_dist.cpp Pages: 1 -->
<svg width="496pt" height="94pt"

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -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: probability/geometric_dist.cpp Pages: 1 -->
<svg width="496pt" height="94pt"

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -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: data_structures/bloom_filter.cpp Pages: 1 -->
<svg width="413pt" height="94pt"

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -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: data_structures/bloom_filter.cpp Pages: 1 -->
<svg width="413pt" height="94pt"

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -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/floyd_warshall.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -140,7 +140,7 @@ $(function(){initNavTree('df/d31/floyd__warshall_8cpp_source.html','../../'); in
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">int</span> **edges;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// Constructs a graph with V vertices and E edges</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_class" href="../../da/d9a/class_graph.html">Graph</a>(<span class="keywordtype">int</span> V) {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> Graph(<span class="keywordtype">int</span> V) {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> this-&gt;vertexNum = V;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> this-&gt;edges = <span class="keyword">new</span> <span class="keywordtype">int</span> *[V];</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; V; i++) {</div>
@@ -150,7 +150,7 @@ $(function(){initNavTree('df/d31/floyd__warshall_8cpp_source.html','../../'); in
<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> }</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <a class="code hl_class" href="../../da/d9a/class_graph.html">~Graph</a>() {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> ~Graph() {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; vertexNum; i++) {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">delete</span>[] edges[i];</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> }</div>
@@ -245,7 +245,7 @@ $(function(){initNavTree('df/d31/floyd__warshall_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_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><b>floyd_warshall.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>

View File

@@ -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::windowed_median::WindowedMedian 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -198,7 +198,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">
@@ -236,7 +236,7 @@ Private Attributes</h2></td></tr>
</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">
@@ -256,15 +256,15 @@ Private Attributes</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../d1/ded/windowed__median_8cpp_source.html#l00095">95</a> of file <a class="el" href="../../d1/ded/windowed__median_8cpp_source.html">windowed_median.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 95</span> {</div>
<div class="line"><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keyword">auto</span> sz = <a class="code hl_variable" href="#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.size();</div>
<div class="line"><span class="lineno"> 97</span> </div>
<div class="line"><span class="lineno"> 97</span></div>
<div class="line"><span class="lineno"> 101</span> <span class="keywordflow">if</span> (value &lt;= *<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> &amp;&amp; sz % 2 == 0) {</div>
<div class="line"><span class="lineno"> 102</span> ++<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; </div>
<div class="line"><span class="lineno"> 103</span> }</div>
<div class="line"><span class="lineno"> 104</span> </div>
<div class="line"><span class="lineno"> 104</span></div>
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value &gt;= *<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> &amp;&amp; sz % 2 != 0) {</div>
<div class="line"><span class="lineno"> 109</span> --<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
<div class="line"><span class="lineno"> 110</span> }</div>
<div class="line"><span class="lineno"> 111</span> </div>
<div class="line"><span class="lineno"> 111</span></div>
<div class="line"><span class="lineno"> 114</span> <span class="keyword">const</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.find(value); <span class="comment">// O(logN)</span></div>
<div class="line"><span class="lineno"> 115</span> <a class="code hl_variable" href="#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.erase(it); <span class="comment">// O(logN)</span></div>
<div class="line"><span class="lineno"> 116</span> }</div>
@@ -291,7 +291,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">
@@ -328,7 +328,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">
@@ -374,7 +374,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">
@@ -424,7 +424,7 @@ Private Attributes</h2></td></tr>
</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">
@@ -450,11 +450,11 @@ Private Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 73</span> <a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> = <a class="code hl_variable" href="#aacd76f078632faee1a8788d031e6c2de">_sortedValues</a>.begin();</div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 75</span> }</div>
<div class="line"><span class="lineno"> 76</span> </div>
<div class="line"><span class="lineno"> 76</span></div>
<div class="line"><span class="lineno"> 80</span> <span class="keywordflow">if</span> (value &lt; *<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> &amp;&amp; sz % 2 == 0) {</div>
<div class="line"><span class="lineno"> 81</span> --<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; <span class="comment">// O(1) - traversing one step to the left child</span></div>
<div class="line"><span class="lineno"> 82</span> }</div>
<div class="line"><span class="lineno"> 83</span> </div>
<div class="line"><span class="lineno"> 83</span></div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (value &gt;= *<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a> &amp;&amp; sz % 2 != 0) {</div>
<div class="line"><span class="lineno"> 87</span> ++<a class="code hl_variable" href="#a55ae3543a76045dffcb5ec7904a32a20">_itMedian</a>; </div>
<div class="line"><span class="lineno"> 88</span> }</div>
@@ -478,7 +478,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">
@@ -503,7 +503,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">
@@ -528,7 +528,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">
@@ -554,7 +554,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">
@@ -574,7 +574,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="../../d4/ded/namespaceprobability.html">probability</a></li><li class="navelem"><b>windowed_median</b></li><li class="navelem"><a class="el" href="../../df/d34/classprobability_1_1windowed__median_1_1_windowed_median.html">WindowedMedian</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>

View File

@@ -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: backtracking/minimax.cpp Pages: 1 -->
<svg width="252pt" height="83pt"

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -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: backtracking/minimax.cpp Pages: 1 -->
<svg width="252pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -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++: search/interpolation_search2.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -225,7 +225,7 @@ Functions</h2></td></tr>
<div class="fragment"><div class="line"><span class="lineno"> 32</span> {</div>
<div class="line"><span class="lineno"> 33</span> <span class="keywordtype">int</span> A[] = {2, 4, 5, 7, 13, 14, 15, 23};</div>
<div class="line"><span class="lineno"> 34</span> <span class="keywordtype">int</span> x = 17;</div>
<div class="line"><span class="lineno"> 35</span> </div>
<div class="line"><span class="lineno"> 35</span></div>
<div class="line"><span class="lineno"> 37</span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="#aa3ec659ec8394d186c761df81ad1f629">InterpolationSearch</a>(A, 8, x);</div>
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">if</span> (index &lt; 0)</div>
<div class="line"><span class="lineno"> 39</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Number &quot;</span> &lt;&lt; x &lt;&lt; <span class="stringliteral">&quot; not found&quot;</span> &lt;&lt; std::endl;</div>
@@ -242,7 +242,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_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><a class="el" href="../../df/d39/interpolation__search2_8cpp.html">interpolation_search2.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>

View File

@@ -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++: search/interpolation_search2.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,9 +124,9 @@ $(function(){initNavTree('df/d39/interpolation__search2_8cpp_source.html','../..
<div class="headertitle"><div class="title">interpolation_search2.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d39/interpolation__search2_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="../../df/d39/interpolation__search2_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="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span></div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="}">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="../../df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629"> 15</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629">InterpolationSearch</a>(<span class="keywordtype">int</span> A[], <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> x) {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">int</span> low = 0;</div>
@@ -144,12 +144,12 @@ $(function(){initNavTree('df/d39/interpolation__search2_8cpp_source.html','../..
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> -1;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>}</div>
</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="foldopen00032" data-start="{" data-end="}">
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../df/d39/interpolation__search2_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 32</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d39/interpolation__search2_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">int</span> A[] = {2, 4, 5, 7, 13, 14, 15, 23};</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">int</span> x = 17;</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="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">int</span> index = <a class="code hl_function" href="../../df/d39/interpolation__search2_8cpp.html#aa3ec659ec8394d186c761df81ad1f629">InterpolationSearch</a>(A, 8, x);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">if</span> (index &lt; 0)</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Number &quot;</span> &lt;&lt; x &lt;&lt; <span class="stringliteral">&quot; not found&quot;</span> &lt;&lt; std::endl;</div>
@@ -169,7 +169,7 @@ $(function(){initNavTree('df/d39/interpolation__search2_8cpp_source.html','../..
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><a class="el" href="../../df/d39/interpolation__search2_8cpp.html">interpolation_search2.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>

View File

@@ -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/exponential_search.cpp Pages: 1 -->
<svg width="244pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -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/exponential_search.cpp Pages: 1 -->
<svg width="244pt" height="94pt"

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -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/binary_search_tree2.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -242,7 +242,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">
@@ -292,7 +292,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">
@@ -340,7 +340,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">
@@ -388,7 +388,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">
@@ -434,7 +434,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">
@@ -480,7 +480,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">
@@ -526,7 +526,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">
@@ -585,7 +585,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">
@@ -635,7 +635,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_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../df/d42/binary__search__tree2_8cpp.html">binary_search_tree2.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>

View File

@@ -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/binary_search_tree2.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,26 +124,28 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="headertitle"><div class="title">binary_search_tree2.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d42/binary__search__tree2_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="../../df/d42/binary__search__tree2_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 &lt;cassert&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;vector&gt;</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="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;</div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html"> 20</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d9/dde/classbinary__search__tree.html">binary_search_tree</a> {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html"> 20</a></span><span class="keyword">class </span><a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa67321ed575ca313cd71d833d91234a6">binary_search_tree</a> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">private</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="../../dd/db6/structbinary__search__tree_1_1bst__node.html"> 25</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html">bst_node</a> {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html"> 25</a></span> <span class="keyword">struct </span><a class="code hl_function" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a51dd9bd6dd32bce3b74dd64557306778">bst_node</a> {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a09da9e5b801ede4764bc812975ff7f29"> 26</a></span> T <a class="code hl_variable" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a09da9e5b801ede4764bc812975ff7f29">value</a>; </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a55c165b9e0e5b50a23104e0604dcc788"> 27</a></span> std::unique_ptr&lt;bst_node&gt; <a class="code hl_variable" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a55c165b9e0e5b50a23104e0604dcc788">left</a>; </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a05f3a7aa6c31622f855ce4b5a95e91df"> 28</a></span> std::unique_ptr&lt;bst_node&gt; <a class="code hl_variable" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a05f3a7aa6c31622f855ce4b5a95e91df">right</a>; </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span></div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="}">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a51dd9bd6dd32bce3b74dd64557306778"> 35</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a51dd9bd6dd32bce3b74dd64557306778">bst_node</a>(T _value) {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <a class="code hl_variable" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a09da9e5b801ede4764bc812975ff7f29">value</a> = _value;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> left = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_variable" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a55c165b9e0e5b50a23104e0604dcc788">left</a> = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <a class="code hl_variable" href="../../dd/db6/structbinary__search__tree_1_1bst__node.html#a05f3a7aa6c31622f855ce4b5a95e91df">right</a> = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> }</div>
</div>
@@ -152,6 +154,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50"> 42</a></span> std::unique_ptr&lt;bst_node&gt; <a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>; </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a07ba32ce1a2af6e357600ac8c8e98dbc"> 43</a></span> std::size_t <a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#a07ba32ce1a2af6e357600ac8c8e98dbc">size_</a> = 0; </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</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="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb"> 53</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, T&amp; ret_value) {</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>
@@ -163,7 +166,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a75f897af6aa732a9901454401c869bcb">find_max</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;right, ret_value);</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="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153"> 71</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, T&amp; ret_value) {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> (!<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
@@ -176,7 +179,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af9a2c7c187a7ca3142c77ce342ef3153">find_min</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;left, ret_value);</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="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></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="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778"> 90</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, T new_value) {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a> == <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> &amp;&amp; !<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>) {</div>
@@ -204,7 +207,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<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> }</div>
</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</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="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153"> 125</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(std::unique_ptr&lt;bst_node&gt;&amp; parent,</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, T rm_value) {</div>
@@ -250,7 +253,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> }</div>
</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span></div>
<div class="foldopen" id="foldopen00177" data-start="{" data-end="}">
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2"> 177</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#aa4f84b2eec9b9201af1840868ddb5fb2">contains</a>(std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, T value) {</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordflow">if</span> (!<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
@@ -266,7 +269,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> }</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> }</div>
</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span></div>
<div class="foldopen" id="foldopen00197" data-start="{" data-end="}">
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a2fcf37549bd002c174a45b0b4203c2bd"> 197</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a2fcf37549bd002c174a45b0b4203c2bd">traverse_inorder</a>(std::function&lt;<span class="keywordtype">void</span>(T)&gt; callback,</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
@@ -279,7 +282,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a2fcf37549bd002c174a45b0b4203c2bd">traverse_inorder</a>(callback, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;right);</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> }</div>
</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> </div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span></div>
<div class="foldopen" id="foldopen00214" data-start="{" data-end="}">
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#ab81edd415324d372632c42dc7dbcb9e1"> 214</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#ab81edd415324d372632c42dc7dbcb9e1">traverse_preorder</a>(std::function&lt;<span class="keywordtype">void</span>(T)&gt; callback,</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
@@ -292,7 +295,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#ab81edd415324d372632c42dc7dbcb9e1">traverse_preorder</a>(callback, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;right);</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> }</div>
</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span></div>
<div class="foldopen" id="foldopen00231" data-start="{" data-end="}">
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a87c0a35845d27e0f6fc1f4eaa0333362"> 231</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a87c0a35845d27e0f6fc1f4eaa0333362">traverse_postorder</a>(std::function&lt;<span class="keywordtype">void</span>(T)&gt; callback,</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> std::unique_ptr&lt;bst_node&gt;&amp; <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
@@ -313,7 +316,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#a07ba32ce1a2af6e357600ac8c8e98dbc">size_</a> = 0;</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="l00251" name="l00251"></a><span class="lineno"> 251</span></div>
<div class="foldopen" id="foldopen00259" data-start="{" data-end="}">
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a8168edf29316f2b436eac1fc416c52e0"> 259</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a8168edf29316f2b436eac1fc416c52e0">insert</a>(T new_value) {</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <span class="keywordtype">bool</span> result = <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a9d1e7e10efa74d741bf48cf032df3778">insert</a>(<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>, new_value);</div>
@@ -323,7 +326,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> }</div>
</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> </div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span></div>
<div class="foldopen" id="foldopen00274" data-start="{" data-end="}">
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a99771c2e1353e8ddfd4bb9d30b7a98fb"> 274</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a99771c2e1353e8ddfd4bb9d30b7a98fb">remove</a>(T rm_value) {</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="keywordtype">bool</span> result = <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#af4a865ce5244608819b169fc78a41153">remove</a>(<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>, <a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>, rm_value);</div>
@@ -333,15 +336,15 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> }</div>
</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span></div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a6bf5b410299df2320ddf2709dda61f63"> 289</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a6bf5b410299df2320ddf2709dda61f63">contains</a>(T value) { <span class="keywordflow">return</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a6bf5b410299df2320ddf2709dda61f63">contains</a>(<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>, value); }</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> </div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span></div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#ad9912e8574538e86f9bd2c38e7e63d03"> 298</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#ad9912e8574538e86f9bd2c38e7e63d03">find_min</a>(T&amp; ret_value) { <span class="keywordflow">return</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#ad9912e8574538e86f9bd2c38e7e63d03">find_min</a>(<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>, ret_value); }</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> </div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span></div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a42b16f26928b5e994925100594a167a0"> 307</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a42b16f26928b5e994925100594a167a0">find_max</a>(T&amp; ret_value) { <span class="keywordflow">return</span> <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a42b16f26928b5e994925100594a167a0">find_max</a>(<a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#aa08f65f6f3bfcb14f8c3d1e65305ae50">root_</a>, ret_value); }</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span></div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3"> 314</a></span> std::size_t <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a564fe43e7e8f7ecb6f10667a70fbc6f3">size</a>() { <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d9/dde/classbinary__search__tree.html#a07ba32ce1a2af6e357600ac8c8e98dbc">size_</a>; }</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> </div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span></div>
<div class="foldopen" id="foldopen00321" data-start="{" data-end="}">
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a1f23830316204664514f396a4eb5275a"> 321</a></span> std::vector&lt;T&gt; <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a1f23830316204664514f396a4eb5275a">get_elements_inorder</a>() {</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> std::vector&lt;T&gt; result;</div>
@@ -350,7 +353,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> }</div>
</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> </div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span></div>
<div class="foldopen" id="foldopen00333" data-start="{" data-end="}">
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a5764c1cf848f84a5b77462036a6d8c13"> 333</a></span> std::vector&lt;T&gt; <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a5764c1cf848f84a5b77462036a6d8c13">get_elements_preorder</a>() {</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> std::vector&lt;T&gt; result;</div>
@@ -359,7 +362,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> }</div>
</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> </div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span></div>
<div class="foldopen" id="foldopen00345" data-start="{" data-end="}">
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"><a class="line" href="../../d9/dde/classbinary__search__tree.html#a5c011e1b0863d79c3a7c11a0426bdcff"> 345</a></span> std::vector&lt;T&gt; <a class="code hl_function" href="../../d9/dde/classbinary__search__tree.html#a5c011e1b0863d79c3a7c11a0426bdcff">get_elements_postorder</a>() {</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> std::vector&lt;T&gt; result;</div>
@@ -370,7 +373,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span>};</div>
</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> </div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span></div>
<div class="foldopen" id="foldopen00358" data-start="{" data-end="}">
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#a8c882f43e1e52948a7841a8bfb091350"> 358</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a8c882f43e1e52948a7841a8bfb091350">test_insert</a>() {</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST insert...&quot;</span>;</div>
@@ -401,7 +404,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span>}</div>
</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span> </div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span></div>
<div class="foldopen" id="foldopen00392" data-start="{" data-end="}">
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#ab1333c3ea06dcad896ee204bbd407c4e"> 392</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#ab1333c3ea06dcad896ee204bbd407c4e">test_remove</a>() {</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST remove...&quot;</span>;</div>
@@ -435,7 +438,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span>}</div>
</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> </div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span></div>
<div class="foldopen" id="foldopen00429" data-start="{" data-end="}">
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#a1d42876440ac5346e2850a32497385c3"> 429</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a1d42876440ac5346e2850a32497385c3">test_contains</a>() {</div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST contains...&quot;</span>;</div>
@@ -455,7 +458,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span>}</div>
</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> </div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span></div>
<div class="foldopen" id="foldopen00452" data-start="{" data-end="}">
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#af2847a901160fd45b4044550e9921cb4"> 452</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#af2847a901160fd45b4044550e9921cb4">test_find_min</a>() {</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST find_min...&quot;</span>;</div>
@@ -475,7 +478,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno"> 468</span>}</div>
</div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno"> 469</span> </div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno"> 469</span></div>
<div class="foldopen" id="foldopen00475" data-start="{" data-end="}">
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#a9856b68e2cba50d2e26a1cbe374e0365"> 475</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a9856b68e2cba50d2e26a1cbe374e0365">test_find_max</a>() {</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST find_max...&quot;</span>;</div>
@@ -495,7 +498,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span>}</div>
</div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> </div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span></div>
<div class="foldopen" id="foldopen00498" data-start="{" data-end="}">
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#a06f35064850e891d6fda0093c0d9ee6e"> 498</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a06f35064850e891d6fda0093c0d9ee6e">test_get_elements_inorder</a>() {</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST get_elements_inorder...&quot;</span>;</div>
@@ -513,7 +516,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno"> 511</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span>}</div>
</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span> </div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span></div>
<div class="foldopen" id="foldopen00519" data-start="{" data-end="}">
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#ab00b8d0f21aeb5fbddb6decf3bcb640a"> 519</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#ab00b8d0f21aeb5fbddb6decf3bcb640a">test_get_elements_preorder</a>() {</div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST get_elements_preorder...&quot;</span>;</div>
@@ -531,7 +534,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_8cpp_source.html','../../
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno"> 532</span> std::cout &lt;&lt; <span class="stringliteral">&quot;ok&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno"> 533</span>}</div>
</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno"> 534</span> </div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno"> 534</span></div>
<div class="foldopen" id="foldopen00540" data-start="{" data-end="}">
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno"><a class="line" href="../../df/d42/binary__search__tree2_8cpp.html#a94b76f781fcbe1ad0e3397ace6bb1965"> 540</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d42/binary__search__tree2_8cpp.html#a94b76f781fcbe1ad0e3397ace6bb1965">test_get_elements_postorder</a>() {</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno"> 541</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Testing BST get_elements_postorder...&quot;</span>;</div>
@@ -602,7 +605,7 @@ $(function(){initNavTree('df/d42/binary__search__tree2_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="../../df/d42/binary__search__tree2_8cpp.html">binary_search_tree2.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>

View File

@@ -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++: n_queens_all_solutions 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d44/namespacen__queens__all__solutions.html','../..
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d44/namespacen__queens__all__solutions.html">n_queens_all_solutions</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>

View File

@@ -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++: cpu_scheduling_algorithms/fcfs_scheduling.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -156,22 +156,31 @@ Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/dca/class_f_c_f_s.html">FCFS&lt; S, T, E &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class which implements the <a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> scheduling algorithm. <a href="../../dd/dca/class_f_c_f_s.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d1b/classpriority__queue.html">priority_queue&lt; T &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">STL class. <a href="../../d1/d1b/classpriority__queue.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d6d/classunordered__set.html">unordered_set&lt; K &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">STL class. <a href="../../d3/d6d/classunordered__set.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/dfc/classvector.html">vector&lt; T &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">STL class. <a href="../../d7/dfc/classvector.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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:a18920aa331faf4476b251c8cdb2c2bec" id="r_a18920aa331faf4476b251c8cdb2c2bec"><td class="memTemplParams" colspan="2">template&lt;typename S , typename T , typename E &gt; </td></tr>
<tr class="memitem:a18920aa331faf4476b251c8cdb2c2bec" id="r_a18920aa331faf4476b251c8cdb2c2bec"><td class="memTemplParams" colspan="2">template&lt;typename S, typename T, typename E&gt; </td></tr>
<tr class="memitem:a18920aa331faf4476b251c8cdb2c2bec"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a> (tuple&lt; S, T, E &gt; &amp;t1, tuple&lt; S, T, E &gt; &amp;t2)</td></tr>
<tr class="memdesc:a18920aa331faf4476b251c8cdb2c2bec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Comparator function for sorting a vector. <br /></td></tr>
<tr class="separator:a18920aa331faf4476b251c8cdb2c2bec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86" id="r_a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplParams" colspan="2">template&lt;typename S , typename T , typename E &gt; </td></tr>
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplItemLeft" align="right" valign="top">vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a> (vector&lt; tuple&lt; uint32_t, uint32_t, uint32_t &gt; &gt; input)</td></tr>
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86" id="r_a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplParams" colspan="2">template&lt;typename S, typename T, typename E&gt; </td></tr>
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../d7/dfc/classvector.html">vector</a>&lt; tuple&lt; S, T, E, double, double, double &gt; &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a> (<a class="el" href="../../d7/dfc/classvector.html">vector</a>&lt; tuple&lt; uint32_t, uint32_t, uint32_t &gt; &gt; input)</td></tr>
<tr class="memdesc:a8f2b90cb64d63a7080965e66a05ccf86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to be used for testing purposes. This function guarantees the correct solution for <a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> scheduling algorithm. <br /></td></tr>
<tr class="separator:a8f2b90cb64d63a7080965e66a05ccf86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d" id="r_aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementations. <br /></td></tr>
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Entry point of the program. <br /></td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="../../dd/d3b/struct_entry.html">Entry</a> point of the program. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
@@ -186,12 +195,12 @@ Functions</h2></td></tr>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename S , typename T , typename E &gt; </div>
template&lt;typename S, typename T, typename E&gt; </div>
<table class="memname">
<tr>
<td class="memname">vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt; get_final_status </td>
<td class="memname"><a class="el" href="../../d7/dfc/classvector.html">vector</a>&lt; tuple&lt; S, T, E, double, double, double &gt; &gt; get_final_status </td>
<td>(</td>
<td class="paramtype">vector&lt; tuple&lt; uint32_t, uint32_t, uint32_t &gt; &gt;</td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
<td class="paramtype"><a class="el" href="../../d7/dfc/classvector.html">vector</a>&lt; tuple&lt; uint32_t, uint32_t, uint32_t &gt; &gt;</td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -252,7 +261,7 @@ template&lt;typename S , typename T , typename E &gt; </div>
</table>
</div><div class="memdoc">
<p>Entry point of the program. </p>
<p><a class="el" href="../../dd/d3b/struct_entry.html">Entry</a> point of the program. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00288">288</a> of file <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html">fcfs_scheduling.cpp</a>.</p>
@@ -270,7 +279,7 @@ template&lt;typename S , typename T , typename E &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename S , typename T , typename E &gt; </div>
template&lt;typename S, typename T, typename E&gt; </div>
<table class="memname">
<tr>
<td class="memname">bool sortcol </td>
@@ -335,7 +344,7 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
</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">
@@ -371,7 +380,7 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
<div class="line"><span class="lineno"> 281</span> cout &lt;&lt; <span class="stringliteral">&quot;All the tests have successfully passed!&quot;</span> &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><span class="lineno"> 282</span>}</div>
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00098">fcfs_scheduling.cpp:98</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00130">fcfs_scheduling.cpp:130</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn&#39;t already there.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00130">fcfs_scheduling.cpp:130</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt; scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00155">fcfs_scheduling.cpp:155</a></div></div>
<div class="ttc" id="afcfs__scheduling_8cpp_html_a8f2b90cb64d63a7080965e66a05ccf86"><div class="ttname"><a href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a></div><div class="ttdeci">vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt; get_final_status(vector&lt; tuple&lt; uint32_t, uint32_t, uint32_t &gt; &gt; input)</div><div class="ttdoc">Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00226">fcfs_scheduling.cpp:226</a></div></div>
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d35/matrix__exponentiation_8cpp_source.html#l00036">matrix_exponentiation.cpp:36</a></div></div>
@@ -384,7 +393,7 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.html">cpu_scheduling_algorithms</a></li><li class="navelem"><a class="el" href="../../df/d47/fcfs__scheduling_8cpp.html">fcfs_scheduling.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>

View File

@@ -2,6 +2,9 @@ var fcfs__scheduling_8cpp =
[
[ "Compare< S, T, E >", "de/d4a/class_compare.html", "de/d4a/class_compare" ],
[ "FCFS< S, T, E >", "dd/dca/class_f_c_f_s.html", "dd/dca/class_f_c_f_s" ],
[ "priority_queue< T >", "d1/d1b/classpriority__queue.html", "d1/d1b/classpriority__queue" ],
[ "unordered_set< K >", "d3/d6d/classunordered__set.html", "d3/d6d/classunordered__set" ],
[ "vector< T >", "d7/dfc/classvector.html", "d7/dfc/classvector" ],
[ "get_final_status", "df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86", null ],
[ "main", "df/d47/fcfs__scheduling_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "sortcol", "df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec", null ],

View File

@@ -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++: cpu_scheduling_algorithms/fcfs_scheduling.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,7 +124,8 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="headertitle"><div class="title">fcfs_scheduling.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d47/fcfs__scheduling_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="../../df/d47/fcfs__scheduling_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 &lt;algorithm&gt;</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
@@ -159,7 +160,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>}</div>
</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E&gt;</div>
<div class="foldopen" id="foldopen00063" data-start="{" data-end="};">
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../de/d4a/class_compare.html"> 63</a></span><span class="keyword">class </span><a class="code hl_class" href="../../de/d4a/class_compare.html">Compare</a> {</div>
@@ -180,7 +181,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span>};</div>
</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E&gt;</div>
<div class="foldopen" id="foldopen00098" data-start="{" data-end="};">
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html"> 98</a></span><span class="keyword">class </span><a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS</a> {</div>
@@ -208,7 +209,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</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="foldopen00155" data-start="{" data-end="}">
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91"> 155</a></span> vector&lt;tuple&lt;S, T, E, double, double, double&gt;&gt; <a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>() {</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="comment">// Variable to keep track of time elapsed so far</span></div>
@@ -242,7 +243,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> }</div>
</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span></div>
<div class="foldopen" id="foldopen00192" data-start="{" data-end="}">
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793"> 192</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793">printResult</a>() {</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> cout &lt;&lt; <span class="stringliteral">&quot;Status of all the proceses post completion is as follows:&quot;</span></div>
@@ -267,7 +268,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span>};</div>
</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span></div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E&gt;</div>
<div class="foldopen" id="foldopen00226" data-start="{" data-end="}">
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86"> 226</a></span>vector&lt;tuple&lt;S, T, E, double, double, double&gt;&gt; <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a>(</div>
@@ -297,7 +298,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span>}</div>
</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> </div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span></div>
<div class="foldopen" id="foldopen00257" data-start="{" data-end="}">
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 257</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i &lt; 1000; i++) {</div>
@@ -326,7 +327,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> cout &lt;&lt; <span class="stringliteral">&quot;All the tests have successfully passed!&quot;</span> &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span>}</div>
</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span></div>
<div class="foldopen" id="foldopen00288" data-start="{" data-end="}">
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 288</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -336,7 +337,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); i
<div class="ttc" id="aclass_compare_html"><div class="ttname"><a href="../../de/d4a/class_compare.html">Compare</a></div><div class="ttdoc">Comparator class for priority queue.</div><div class="ttdef"><b>Definition</b> <a href="#l00063">fcfs_scheduling.cpp:63</a></div></div>
<div class="ttc" id="aclass_compare_html_afbdf9a44adb49728dc704155d7d1570c"><div class="ttname"><a href="../../de/d4a/class_compare.html#afbdf9a44adb49728dc704155d7d1570c">Compare::operator()</a></div><div class="ttdeci">bool operator()(tuple&lt; S, T, E, double, double, double &gt; &amp;t1, tuple&lt; S, T, E, double, double, double &gt; &amp;t2)</div><div class="ttdoc">A comparator function that checks whether to swap the two tuples or not. to https://www....</div><div class="ttdef"><b>Definition</b> <a href="#l00076">fcfs_scheduling.cpp:76</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> <a href="#l00098">fcfs_scheduling.cpp:98</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> <a href="#l00130">fcfs_scheduling.cpp:130</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn&#39;t already there.</div><div class="ttdef"><b>Definition</b> <a href="#l00130">fcfs_scheduling.cpp:130</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt; scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> <a href="#l00155">fcfs_scheduling.cpp:155</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_abb361a612b18bb189aa6d3c49288b793"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793">FCFS::printResult</a></div><div class="ttdeci">void printResult()</div><div class="ttdoc">Utility function for printing the status of each process after execution.</div><div class="ttdef"><b>Definition</b> <a href="#l00192">fcfs_scheduling.cpp:192</a></div></div>
<div class="ttc" id="aclass_f_c_f_s_html_af2594e22a867b308e027623940193d46"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">FCFS::schedule</a></div><div class="ttdeci">priority_queue&lt; tuple&lt; S, T, E, double, double, double &gt;, vector&lt; tuple&lt; S, T, E, double, double, double &gt; &gt;, Compare&lt; S, T, E &gt; &gt; schedule</div><div class="ttdef"><b>Definition</b> <a href="#l00112">fcfs_scheduling.cpp:112</a></div></div>
@@ -351,7 +352,7 @@ $(function(){initNavTree('df/d47/fcfs__scheduling_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_cc8e79ed9d2b7756c78e8d0c87c6c0c7.html">cpu_scheduling_algorithms</a></li><li class="navelem"><a class="el" href="../../df/d47/fcfs__scheduling_8cpp.html">fcfs_scheduling.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>

View File

@@ -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/stack.hpp 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -163,7 +163,7 @@ Classes</h2></td></tr>
<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="../../df/d47/stack_8hpp.html">stack.hpp</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>

View File

@@ -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/stack.hpp 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,20 +124,20 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
<div class="headertitle"><div class="title">stack.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d47/stack_8hpp.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="../../df/d47/stack_8hpp.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><span class="preprocessor">#ifndef DATA_STRUCTURES_STACK_HPP_</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define DATA_STRUCTURES_STACK_HPP_</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 &lt;stdexcept&gt;</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 &quot;<a class="code" href="../../d3/d09/node_8hpp.html">node.hpp</a>&quot;</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="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">template</span> &lt;<span class="keyword">class</span> ValueType&gt;</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="../../d1/dc2/classstack.html"> 19</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a> {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">using </span>value_type = ValueType;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span></div>
<div class="foldopen" id="foldopen00024" data-start="{" data-end="}">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a8bce109630118a34faae717f72986033"> 24</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a8bce109630118a34faae717f72986033">display</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Top --&gt; &quot;</span>;</div>
@@ -160,7 +160,7 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </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="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5"> 44</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5">isEmptyStack</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> == <span class="keyword">nullptr</span>); }</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="foldopen00047" data-start="{" data-end="}">
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d"> 47</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(<span class="keyword">const</span> value_type&amp; item) {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">auto</span> newNode = std::make_shared&lt;Node&lt;value_type&gt;&gt;();</div>
@@ -170,14 +170,14 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a>++;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span></div>
<div class="foldopen" id="foldopen00056" data-start="{" data-end="}">
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709"> 56</a></span> value_type <a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> ensureNotEmpty();</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>-&gt;data;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</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="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0"> 62</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>() {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> ensureNotEmpty();</div>
@@ -185,7 +185,7 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a>--;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
</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="foldopen00069" data-start="{" data-end="}">
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a6f13157faa1a762c59e67da8b9516092"> 69</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a6f13157faa1a762c59e67da8b9516092">clear</a>() {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> = <span class="keyword">nullptr</span>;</div>
@@ -219,7 +219,7 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
<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="../../df/d47/stack_8hpp.html">stack.hpp</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>

View File

@@ -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++: selection_sort_recursive 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d4a/namespaceselection__sort__recursive.html','../.
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d4a/namespaceselection__sort__recursive.html">selection_sort_recursive</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>

View File

@@ -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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -142,7 +142,7 @@ $(function(){initNavTree('d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.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>

View File

@@ -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: hashing/chaining.cpp Pages: 1 -->
<svg width="252pt" height="83pt"

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -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: hashing/chaining.cpp Pages: 1 -->
<svg width="252pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -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/vector_cross_product.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -282,27 +282,27 @@ Example:</h3>
<p class="definition">Definition at line <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html#l00109">109</a> of file <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html">vector_cross_product.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 109</span> {</div>
<div class="line"><span class="lineno"> 110</span> </div>
<div class="line"><span class="lineno"> 110</span></div>
<div class="line"><span class="lineno"> 112</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
<div class="line"><span class="lineno"> 113</span> </div>
<div class="line"><span class="lineno"> 114</span> std::array&lt;double, 3&gt; vec1;</div>
<div class="line"><span class="lineno"> 115</span> std::array&lt;double, 3&gt; vec2;</div>
<div class="line"><span class="lineno"> 116</span> </div>
<div class="line"><span class="lineno"> 116</span></div>
<div class="line"><span class="lineno"> 118</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the first Vector: &quot;</span>;</div>
<div class="line"><span class="lineno"> 119</span> std::cin &gt;&gt; vec1[0] &gt;&gt; vec1[1] &gt;&gt; vec1[2];</div>
<div class="line"><span class="lineno"> 120</span> </div>
<div class="line"><span class="lineno"> 120</span></div>
<div class="line"><span class="lineno"> 122</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the second Vector: &quot;</span>;</div>
<div class="line"><span class="lineno"> 123</span> std::cin &gt;&gt; vec2[0] &gt;&gt; vec2[1] &gt;&gt; vec2[2];</div>
<div class="line"><span class="lineno"> 124</span> </div>
<div class="line"><span class="lineno"> 124</span></div>
<div class="line"><span class="lineno"> 126</span> std::array&lt;double, 3&gt; product = <a class="code hl_function" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>(vec1, vec2);</div>
<div class="line"><span class="lineno"> 127</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nThe cross product is: &quot;</span> &lt;&lt; product[0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[2] &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 128</span> </div>
<div class="line"><span class="lineno"> 128</span></div>
<div class="line"><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Magnitude: &quot;</span> &lt;&lt; <a class="code hl_function" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>(product) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 131</span> </div>
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 133</span>}</div>
<div class="ttc" id="avector__cross__product_8cpp_html_a225732399c5c076976eae5b180a9f8c9"><div class="ttname"><a href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a></div><div class="ttdeci">std::array&lt; double, 3 &gt; cross(const std::array&lt; double, 3 &gt; &amp;A, const std::array&lt; double, 3 &gt; &amp;B)</div><div class="ttdoc">Function to calculate the cross product of the passed arrays containing the direction ratios of the t...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00069">vector_cross_product.cpp:69</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it's direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00083">vector_cross_product.cpp:83</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it&#39;s direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00083">vector_cross_product.cpp:83</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">namespace math</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00094">vector_cross_product.cpp:94</a></div></div>
</div><!-- fragment -->
</div>
@@ -325,7 +325,7 @@ Example:</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">
@@ -340,7 +340,7 @@ Example:</h3>
<div class="fragment"><div class="line"><span class="lineno"> 94</span> {</div>
<div class="line"><span class="lineno"> 96</span> std::array&lt;double, 3&gt; t_vec = <a class="code hl_function" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>({1, 2, 3}, {4, 5, 6});</div>
<div class="line"><span class="lineno"> 97</span> assert(t_vec[0] == -3 &amp;&amp; t_vec[1] == 6 &amp;&amp; t_vec[2] == -3);</div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 98</span></div>
<div class="line"><span class="lineno"> 100</span> <span class="keywordtype">double</span> t_mag = <a class="code hl_function" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>({6, 8, 0});</div>
<div class="line"><span class="lineno"> 101</span> assert(t_mag == 10);</div>
<div class="line"><span class="lineno"> 102</span>}</div>
@@ -353,7 +353,7 @@ Example:</h3>
<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="../../df/d66/vector__cross__product_8cpp.html">vector_cross_product.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>

View File

@@ -1,7 +1,7 @@
var vector__cross__product_8cpp =
[
[ "cross", "df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9", null ],
[ "mag", "df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8", null ],
[ "math::vector_cross::cross", "df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9", null ],
[ "math::vector_cross::mag", "df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8", null ],
[ "main", "df/d66/vector__cross__product_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "test", "df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
];

View File

@@ -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/vector_cross_product.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,12 +124,13 @@ $(function(){initNavTree('df/d66/vector__cross__product_8cpp_source.html','../..
<div class="headertitle"><div class="title">vector_cross_product.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d66/vector__cross__product_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="../../df/d66/vector__cross__product_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="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor">#include &lt;cassert&gt;</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="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/d91/namespacevector__cross.html">vector_cross</a> {</div>
<div class="foldopen" id="foldopen00069" data-start="{" data-end="}">
@@ -141,7 +142,7 @@ $(function(){initNavTree('df/d66/vector__cross__product_8cpp_source.html','../..
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">return</span> product;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span></div>
<div class="foldopen" id="foldopen00083" data-start="{" data-end="}">
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8"> 83</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">mag</a>(<span class="keyword">const</span> std::array&lt;double, 3&gt; &amp;vec) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">double</span> magnitude = sqrt((vec[0] * vec[0]) + (vec[1] * vec[1]) + (vec[2] * vec[2]));</div>
@@ -150,35 +151,35 @@ $(function(){initNavTree('df/d66/vector__cross__product_8cpp_source.html','../..
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> } </div>
<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> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span></div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 94</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::array&lt;double, 3&gt; t_vec = math::vector_cross::cross({1, 2, 3}, {4, 5, 6});</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::array&lt;double, 3&gt; t_vec = <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>({1, 2, 3}, {4, 5, 6});</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(t_vec[0] == -3 &amp;&amp; t_vec[1] == 6 &amp;&amp; t_vec[2] == -3);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">double</span> t_mag = math::vector_cross::mag({6, 8, 0});</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">double</span> t_mag = <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>({6, 8, 0});</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> assert(t_mag == 10);</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="foldopen" id="foldopen00109" data-start="{" data-end="}">
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 109</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</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> std::array&lt;double, 3&gt; vec1;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::array&lt;double, 3&gt; vec2;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the first Vector: &quot;</span>;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> std::cin &gt;&gt; vec1[0] &gt;&gt; vec1[1] &gt;&gt; vec1[2];</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the second Vector: &quot;</span>;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> std::cin &gt;&gt; vec2[0] &gt;&gt; vec2[1] &gt;&gt; vec2[2];</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> std::array&lt;double, 3&gt; product = math::vector_cross::cross(vec1, vec2);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> std::array&lt;double, 3&gt; product = <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>(vec1, vec2);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nThe cross product is: &quot;</span> &lt;&lt; product[0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[2] &lt;&lt; std::endl;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Magnitude: &quot;</span> &lt;&lt; math::vector_cross::mag(product) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Magnitude: &quot;</span> &lt;&lt; <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>(product) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>}</div>
@@ -186,7 +187,7 @@ $(function(){initNavTree('df/d66/vector__cross__product_8cpp_source.html','../..
<div class="ttc" id="anamespacemath_html"><div class="ttname"><a href="../../dd/d47/namespacemath.html">math</a></div><div class="ttdoc">for assert</div></div>
<div class="ttc" id="anamespacevector__cross_html"><div class="ttname"><a href="../../d4/d91/namespacevector__cross.html">vector_cross</a></div><div class="ttdoc">Functions for Vector Cross Product algorithms.</div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a225732399c5c076976eae5b180a9f8c9"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a></div><div class="ttdeci">std::array&lt; double, 3 &gt; cross(const std::array&lt; double, 3 &gt; &amp;A, const std::array&lt; double, 3 &gt; &amp;B)</div><div class="ttdoc">Function to calculate the cross product of the passed arrays containing the direction ratios of the t...</div><div class="ttdef"><b>Definition</b> <a href="#l00069">vector_cross_product.cpp:69</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it's direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="#l00083">vector_cross_product.cpp:83</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it&#39;s direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="#l00083">vector_cross_product.cpp:83</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">namespace math</div><div class="ttdef"><b>Definition</b> <a href="#l00094">vector_cross_product.cpp:94</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/d66/vector__cross__product_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="#l00109">vector_cross_product.cpp:109</a></div></div>
</div><!-- fragment --></div><!-- contents -->
@@ -195,7 +196,7 @@ $(function(){initNavTree('df/d66/vector__cross__product_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="../../df/d66/vector__cross__product_8cpp.html">vector_cross_product.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>

View File

@@ -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 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -235,21 +235,21 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 119</span> <span class="keywordflow">return</span> {inf, inf};</div>
<div class="line"><span class="lineno"> 120</span> }</div>
<div class="line"><span class="lineno"> 121</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> num = (b.y - a.y + mod), den = (b.x - a.x + mod);</div>
<div class="line"><span class="lineno"> 122</span> lambda = (num * (exp(den, mod - 2, mod))) % mod;</div>
<div class="line"><span class="lineno"> 122</span> lambda = (num * (<a class="code hl_function" href="#ac00616a4e40d3cd5cfb4da87d9ff9af0">exp</a>(den, mod - 2, mod))) % mod;</div>
<div class="line"><span class="lineno"> 123</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 134</span> <span class="keywordflow">if</span> (!a.y) {</div>
<div class="line"><span class="lineno"> 135</span> <span class="keywordflow">return</span> {inf, inf};</div>
<div class="line"><span class="lineno"> 136</span> }</div>
<div class="line"><span class="lineno"> 137</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> axsq = ((a.x * a.x)) % mod;</div>
<div class="line"><span class="lineno"> 137</span> uint256_t axsq = ((a.x * a.x)) % mod;</div>
<div class="line"><span class="lineno"> 138</span> <span class="comment">// Mulitply by 3 adjustment</span></div>
<div class="line"><span class="lineno"> 139</span> axsq += (axsq &lt;&lt; 1);</div>
<div class="line"><span class="lineno"> 140</span> axsq %= mod;</div>
<div class="line"><span class="lineno"> 141</span> <span class="comment">// Mulitply by 2 adjustment</span></div>
<div class="line"><span class="lineno"> 142</span> <a class="code hl_class" href="../../d1/d83/classuint256__t.html">uint256_t</a> a_2 = (a.y &lt;&lt; 1);</div>
<div class="line"><span class="lineno"> 142</span> uint256_t a_2 = (a.y &lt;&lt; 1);</div>
<div class="line"><span class="lineno"> 143</span> lambda =</div>
<div class="line"><span class="lineno"> 144</span> (((axsq + curve_a_coeff) % mod) * <a class="code hl_function" href="#ac00616a4e40d3cd5cfb4da87d9ff9af0">exp</a>(a_2, mod - 2, mod)) % mod;</div>
<div class="line"><span class="lineno"> 145</span> }</div>
<div class="line"><span class="lineno"> 146</span> <a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a> c;</div>
<div class="line"><span class="lineno"> 146</span> <a class="code hl_struct" href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">Point</a> c;</div>
<div class="line"><span class="lineno"> 147</span> <span class="comment">// new point: x = ((lambda^2) - x1 - x2)</span></div>
<div class="line"><span class="lineno"> 148</span> <span class="comment">// y = (lambda * (x1 - x)) - y1</span></div>
<div class="line"><span class="lineno"> 149</span> c.x = ((lambda * lambda) % mod + (mod &lt;&lt; 1) - a.x - b.x) % mod;</div>
@@ -258,8 +258,8 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 152</span>}</div>
<div class="ttc" id="aclassuint256__t_html"><div class="ttname"><a href="../../d1/d83/classuint256__t.html">uint256_t</a></div><div class="ttdoc">class for 256-bit unsigned integer</div><div class="ttdef"><b>Definition</b> <a href="../../da/da3/uint256__t_8hpp_source.html#l00033">uint256_t.hpp:33</a></div></div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html_ac00616a4e40d3cd5cfb4da87d9ff9af0"><div class="ttname"><a href="#ac00616a4e40d3cd5cfb4da87d9ff9af0">ciphers::elliptic_curve_key_exchange::exp</a></div><div class="ttdeci">uint256_t exp(uint256_t number, uint256_t power, const uint256_t &amp;mod)</div><div class="ttdoc">This function calculates number raised to exponent power under modulo mod using Modular Exponentiatio...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d2c/elliptic__curve__key__exchange_8cpp_source.html#l00078">elliptic_curve_key_exchange.cpp:78</a></div></div>
<div class="ttc" id="astruct_point_html"><div class="ttname"><a href="../../d8/dc8/struct_point.html">Point</a></div><div class="ttdef"><b>Definition</b> <a href="../../d8/d6c/line__segment__intersection_8cpp_source.html#l00012">line_segment_intersection.cpp:12</a></div></div>
<div class="ttc" id="astruct_point_html_a2e1b5fb2b2a83571f5c0bc0f66a73cf7"><div class="ttname"><a href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">Point::y</a></div><div class="ttdeci">int y</div><div class="ttdoc">Point respect to x coordinate.</div><div class="ttdef"><b>Definition</b> <a href="../../d8/d6c/line__segment__intersection_8cpp_source.html#l00014">line_segment_intersection.cpp:14</a></div></div>
<div class="ttc" id="astructciphers_1_1elliptic__curve__key__exchange_1_1_point_html"><div class="ttname"><a href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a></div><div class="ttdoc">Definition of struct Point.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d2c/elliptic__curve__key__exchange_8cpp_source.html#l00046">elliptic_curve_key_exchange.cpp:46</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -387,7 +387,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 188</span>}</div>
<div class="ttc" id="anamespaceciphers_1_1elliptic__curve__key__exchange_html_acc5fe9c2032fb7582c38a20d1fa69bcf"><div class="ttname"><a href="#acc5fe9c2032fb7582c38a20d1fa69bcf">ciphers::elliptic_curve_key_exchange::addition</a></div><div class="ttdeci">Point addition(Point a, Point b, const uint256_t &amp;curve_a_coeff, uint256_t mod)</div><div class="ttdoc">Addition of points.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d2c/elliptic__curve__key__exchange_8cpp_source.html#l00110">elliptic_curve_key_exchange.cpp:110</a></div></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 class="ttc" id="astructciphers_1_1elliptic__curve__key__exchange_1_1_point_html"><div class="ttname"><a href="../../d6/d45/structciphers_1_1elliptic__curve__key__exchange_1_1_point.html">ciphers::elliptic_curve_key_exchange::Point</a></div><div class="ttdoc">Definition of struct Point.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d2c/elliptic__curve__key__exchange_8cpp_source.html#l00046">elliptic_curve_key_exchange.cpp:46</a></div></div>
<div class="ttc" id="astruct_point_html"><div class="ttname"><a href="../../d8/dc8/struct_point.html">Point</a></div><div class="ttdef"><b>Definition</b> <a href="../../d8/d6c/line__segment__intersection_8cpp_source.html#l00012">line_segment_intersection.cpp:12</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -397,7 +397,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="../../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="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>

View File

@@ -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_division.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -248,13 +248,12 @@ Functions</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../df/d72/modular__division_8cpp_source.html#l00075">75</a> of file <a class="el" href="../../df/d72/modular__division_8cpp_source.html">modular_division.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 75</span> {</div>
<div class="line"><span class="lineno"> 76</span> uint64_t inverse = <a class="code hl_function" href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a>(b, p - 2, p) % p; </div>
<div class="line"><span class="lineno"> 77</span> uint64_t <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a> =</div>
<div class="line"><span class="lineno"> 76</span> uint64_t inverse = <a class="code hl_function" href="#a66cdf93153cbd1408bd74ac68961d179">power</a>(b, p - 2, p) % p; </div>
<div class="line"><span class="lineno"> 77</span> uint64_t result =</div>
<div class="line"><span class="lineno"> 78</span> ((a % p) * (inverse % p)) % p; </div>
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><span class="lineno"> 80</span>}</div>
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> <a href="../../de/dc3/fibonacci__sum_8cpp_source.html#l00077">fibonacci_sum.cpp:77</a></div></div>
<div class="ttc" id="apower__for__huge__numbers_8cpp_html_ae249a2af508aa94266023ce8aa81426f"><div class="ttname"><a href="../../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f">power</a></div><div class="ttdeci">void power(int x, int n)</div><div class="ttdef"><b>Definition</b> <a href="../../df/def/power__for__huge__numbers_8cpp_source.html#l00056">power_for_huge_numbers.cpp:56</a></div></div>
<div class="ttc" id="amodular__division_8cpp_html_a66cdf93153cbd1408bd74ac68961d179"><div class="ttname"><a href="#a66cdf93153cbd1408bd74ac68961d179">math::modular_division::power</a></div><div class="ttdeci">uint64_t power(uint64_t a, uint64_t b, uint64_t c)</div><div class="ttdoc">This function calculates a raised to exponent b under modulo c using modular exponentiation.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d72/modular__division_8cpp_source.html#l00050">modular_division.cpp:50</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -336,7 +335,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">
@@ -370,7 +369,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="../../df/d72/modular__division_8cpp.html">modular_division.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>

View File

@@ -1,7 +1,7 @@
var modular__division_8cpp =
[
[ "main", "df/d72/modular__division_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
[ "mod_division", "df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7", null ],
[ "power", "df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179", null ],
[ "math::modular_division::mod_division", "df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7", null ],
[ "math::modular_division::power", "df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179", null ],
[ "test", "df/d72/modular__division_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
];

View File

@@ -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_division.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,15 +124,16 @@ $(function(){initNavTree('df/d72/modular__division_8cpp_source.html','../../');
<div class="headertitle"><div class="title">modular_division.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d72/modular__division_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="../../df/d72/modular__division_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="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include &lt;iostream&gt;</span> </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="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d1/d64/namespacemodular__division.html">modular_division</a> {</div>
<div class="foldopen" id="foldopen00050" data-start="{" data-end="}">
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179"> 50</a></span>uint64_t power(uint64_t a, uint64_t b, uint64_t c) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179"> 50</a></span>uint64_t <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179">power</a>(uint64_t a, uint64_t b, uint64_t c) {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> uint64_t ans = 1; </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> a = a % c; </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">if</span> (a == 0) {</div>
@@ -148,10 +149,10 @@ $(function(){initNavTree('df/d72/modular__division_8cpp_source.html','../../');
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> ans;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>}</div>
</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="foldopen00075" data-start="{" data-end="}">
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7"> 75</a></span>uint64_t <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">mod_division</a>(uint64_t a, uint64_t b, uint64_t p) {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> uint64_t inverse = power(b, p - 2, p) % p; </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> uint64_t inverse = <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179">power</a>(b, p - 2, p) % p; </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> uint64_t result =</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> ((a % p) * (inverse % p)) % p; </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">return</span> result;</div>
@@ -159,27 +160,27 @@ $(function(){initNavTree('df/d72/modular__division_8cpp_source.html','../../');
</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>} <span class="comment">// namespace modular_division</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span>} <span class="comment">// namespace math</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</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="../../df/d72/modular__division_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 89</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> uint64_t test_case_1 = math::modular_division::mod_division(8, 2, 2);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> uint64_t test_case_1 = <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(8, 2, 2);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> assert(test_case_1 == 0);</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 1 Passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> uint64_t test_case_2 = math::modular_division::mod_division(15, 3, 7);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> uint64_t test_case_2 = <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(15, 3, 7);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> assert(test_case_2 == 5);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 2 Passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> uint64_t test_case_3 = math::modular_division::mod_division(10, 5, 2);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> uint64_t test_case_3 = <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(10, 5, 2);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(test_case_3 == 0);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 3 Passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> uint64_t test_case_4 = math::modular_division::mod_division(81, 3, 5);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> uint64_t test_case_4 = <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(81, 3, 5);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> assert(test_case_4 == 2);</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 4 Passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> uint64_t test_case_5 = math::modular_division::mod_division(12848, 73, 29);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> uint64_t test_case_5 = <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a>(12848, 73, 29);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> assert(test_case_5 == 2);</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 5 Passed!&quot;</span> &lt;&lt; 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="foldopen00113" data-start="{" data-end="}">
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="../../df/d72/modular__division_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 113</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="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_function" href="../../df/d72/modular__division_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
@@ -187,6 +188,7 @@ $(function(){initNavTree('df/d72/modular__division_8cpp_source.html','../../');
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span>}</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="amodular__division_8cpp_html_a66cdf93153cbd1408bd74ac68961d179"><div class="ttname"><a href="../../df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179">math::modular_division::power</a></div><div class="ttdeci">uint64_t power(uint64_t a, uint64_t b, uint64_t c)</div><div class="ttdoc">This function calculates a raised to exponent b under modulo c using modular exponentiation.</div><div class="ttdef"><b>Definition</b> <a href="#l00050">modular_division.cpp:50</a></div></div>
<div class="ttc" id="amodular__division_8cpp_html_a905e368ae121beb7e7ea35349ddcdac7"><div class="ttname"><a href="../../df/d72/modular__division_8cpp.html#a905e368ae121beb7e7ea35349ddcdac7">math::modular_division::mod_division</a></div><div class="ttdeci">uint64_t mod_division(uint64_t a, uint64_t b, uint64_t p)</div><div class="ttdoc">This function calculates modular division.</div><div class="ttdef"><b>Definition</b> <a href="#l00075">modular_division.cpp:75</a></div></div>
<div class="ttc" id="amodular__division_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d72/modular__division_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition</b> <a href="#l00089">modular_division.cpp:89</a></div></div>
<div class="ttc" id="anamespacemath_html"><div class="ttname"><a href="../../dd/d47/namespacemath.html">math</a></div><div class="ttdoc">for assert</div></div>
@@ -197,7 +199,7 @@ $(function(){initNavTree('df/d72/modular__division_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="../../df/d72/modular__division_8cpp.html">modular_division.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>

View File

@@ -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++: subarray_sum 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d74/namespacesubarray__sum.html','../../'); initRes
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d74/namespacesubarray__sum.html">subarray_sum</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>

View File

@@ -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++: fibonacci 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d76/namespacefibonacci.html','../../'); initResizab
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d76/namespacefibonacci.html">fibonacci</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>

View File

@@ -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/connected_components.cpp Pages: 1 -->
<svg width="262pt" height="83pt"

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -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/connected_components.cpp Pages: 1 -->
<svg width="262pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -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++: graph/breadth_first_search.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -230,7 +230,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 203</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 204</span>}</div>
<div class="ttc" id="abreadth__first__search_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdef"><b>Definition</b> <a href="../../df/d82/breadth__first__search_8cpp_source.html#l00139">breadth_first_search.cpp:139</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a></div><div class="ttdef"><b>Definition</b> <a href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00053">lowest_common_ancestor.cpp:53</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a></div><div class="ttdef"><b>Definition</b> <a href="../../df/d82/breadth__first__search_8cpp_source.html#l00064">breadth_first_search.cpp:64</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><!-- fragment -->
</div>
@@ -253,7 +253,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">
@@ -278,12 +278,12 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 152</span> </div>
<div class="line"><span class="lineno"> 153</span> assert(returned_result == correct_result);</div>
<div class="line"><span class="lineno"> 154</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 1 Passed...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 155</span> </div>
<div class="line"><span class="lineno"> 155</span></div>
<div class="line"><span class="lineno"> 157</span> returned_result = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>.breadth_first_search(0);</div>
<div class="line"><span class="lineno"> 158</span> </div>
<div class="line"><span class="lineno"> 159</span> assert(returned_result == correct_result);</div>
<div class="line"><span class="lineno"> 160</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 2 Passed...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 161</span> </div>
<div class="line"><span class="lineno"> 161</span></div>
<div class="line"><span class="lineno"> 163</span> <a class="code hl_class" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph&lt;std::string&gt;</a> g2;</div>
<div class="line"><span class="lineno"> 164</span> </div>
<div class="line"><span class="lineno"> 165</span> g2.<a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19">add_edge</a>(<span class="stringliteral">&quot;Gorakhpur&quot;</span>, <span class="stringliteral">&quot;Lucknow&quot;</span>, <span class="keyword">false</span>);</div>
@@ -316,7 +316,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_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li><li class="navelem"><a class="el" href="../../df/d82/breadth__first__search_8cpp.html">breadth_first_search.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>

View File

@@ -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++: graph/breadth_first_search.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,7 +124,7 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div class="headertitle"><div class="title">breadth_first_search.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d82/breadth__first__search_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="../../df/d82/breadth__first__search_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="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
@@ -133,15 +133,16 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="preprocessor">#include &lt;queue&gt;</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="preprocessor">#include &lt;vector&gt;</span></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="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a> {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment">/* Class Graph definition */</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="keyword">class </span><a class="code hl_class" href="../../da/d9a/class_graph.html">Graph</a> {</div>
<div class="foldopen" id="foldopen00064" data-start="{" data-end="};">
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../dc/d61/classgraph_1_1_graph.html"> 64</a></span><span class="keyword">class </span>Graph {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0"> 69</a></span> std::map&lt;T, std::list&lt;T&gt; &gt; <a class="code hl_variable" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <a class="code hl_class" href="../../dc/d61/classgraph_1_1_graph.html">Graph</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> Graph() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</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="../../dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19"> 74</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19">add_edge</a>(T u, T v, <span class="keywordtype">bool</span> bidir = <span class="keyword">true</span>) {</div>
@@ -152,19 +153,19 @@ $(function(){initNavTree('df/d82/breadth__first__search_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> }</div>
</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span></div>
<div class="foldopen" id="foldopen00096" data-start="{" data-end="}">
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="../../dc/d61/classgraph_1_1_graph.html#a3755ec9e6a842238c7f4aac10b661981"> 96</a></span> std::map&lt;T, bool&gt; <a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a3755ec9e6a842238c7f4aac10b661981">breadth_first_search</a>(T src) {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> std::map&lt;T, bool&gt; visited;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span> &amp;adjlist : <a class="code hl_variable" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>) {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> visited[adjlist.first] = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> <span class="keyword">const</span> &amp;<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> : <a class="code hl_variable" href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">adjacency_list</a>[adjlist.first]) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> visited[<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>] = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> visited[<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>] = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> }</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> std::queue&lt;T&gt; tracker;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> tracker.push(src);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> visited[src] = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">while</span> (!tracker.empty()) {</div>
@@ -181,9 +182,10 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> }</div>
</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>};</div>
</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="comment">/* Class definition ends */</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span>} <span class="comment">// namespace graph</span></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="foldopen00139" data-start="{" data-end="}">
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="../../df/d82/breadth__first__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 139</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d82/breadth__first__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <a class="code hl_class" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph&lt;int&gt;</a> g;</div>
@@ -200,12 +202,12 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> assert(returned_result == correct_result);</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 1 Passed...&quot;</span> &lt;&lt; std::endl;</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="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> returned_result = g.breadth_first_search(0);</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> assert(returned_result == correct_result);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 2 Passed...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <a class="code hl_class" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph&lt;std::string&gt;</a> g2;</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> g2.<a class="code hl_function" href="../../dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19">add_edge</a>(<span class="stringliteral">&quot;Gorakhpur&quot;</span>, <span class="stringliteral">&quot;Lucknow&quot;</span>, <span class="keyword">false</span>);</div>
@@ -228,7 +230,7 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 3 Passed...&quot;</span> &lt;&lt; std::endl;</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="foldopen00186" data-start="{" data-end="}">
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="../../df/d82/breadth__first__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 186</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d82/breadth__first__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <a class="code hl_function" href="../../df/d82/breadth__first__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>();</div>
@@ -250,11 +252,9 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span>}</div>
</div>
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</a></div></div>
<div class="ttc" id="abreadth__first__search_8cpp_html_a483bb8ccf42aaf7375a83e91490eda1e"><div class="ttname"><a href="../../df/d82/breadth__first__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a></div><div class="ttdeci">static void tests()</div><div class="ttdef"><b>Definition</b> <a href="#l00139">breadth_first_search.cpp:139</a></div></div>
<div class="ttc" id="abreadth__first__search_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/d82/breadth__first__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00186">breadth_first_search.cpp:186</a></div></div>
<div class="ttc" id="aclass_graph_html"><div class="ttname"><a href="../../da/d9a/class_graph.html">Graph</a></div><div class="ttdef"><b>Definition</b> <a href="../../df/d14/bellman__ford_8cpp_source.html#l00014">bellman_ford.cpp:14</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a></div><div class="ttdef"><b>Definition</b> <a href="../../de/dde/lowest__common__ancestor_8cpp_source.html#l00053">lowest_common_ancestor.cpp:53</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph</a></div><div class="ttdef"><b>Definition</b> <a href="#l00064">breadth_first_search.cpp:64</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html_a3755ec9e6a842238c7f4aac10b661981"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html#a3755ec9e6a842238c7f4aac10b661981">graph::Graph::breadth_first_search</a></div><div class="ttdeci">std::map&lt; T, bool &gt; breadth_first_search(T src)</div><div class="ttdef"><b>Definition</b> <a href="#l00096">breadth_first_search.cpp:96</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html_a877b2cba40d8d46dde6fb4209effed19"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html#a877b2cba40d8d46dde6fb4209effed19">graph::Graph::add_edge</a></div><div class="ttdeci">void add_edge(T u, T v, bool bidir=true)</div><div class="ttdef"><b>Definition</b> <a href="#l00074">breadth_first_search.cpp:74</a></div></div>
<div class="ttc" id="aclassgraph_1_1_graph_html_acebf0505d625b043bb9c8c27c7a8def0"><div class="ttname"><a href="../../dc/d61/classgraph_1_1_graph.html#acebf0505d625b043bb9c8c27c7a8def0">graph::Graph::adjacency_list</a></div><div class="ttdeci">std::map&lt; T, std::list&lt; T &gt; &gt; adjacency_list</div><div class="ttdef"><b>Definition</b> <a href="#l00069">breadth_first_search.cpp:69</a></div></div>
@@ -266,7 +266,7 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li><li class="navelem"><a class="el" href="../../df/d82/breadth__first__search_8cpp.html">breadth_first_search.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>

View File

@@ -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::HKGraph Pages: 1 -->
<svg width="220pt" height="194pt"

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -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::HKGraph Pages: 1 -->
<svg width="220pt" height="194pt"

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -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: strings/rabin_karp.cpp Pages: 1 -->
<svg width="252pt" height="83pt"

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -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: strings/rabin_karp.cpp Pages: 1 -->
<svg width="252pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -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++: dp 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -136,7 +136,7 @@ $(function(){initNavTree('df/d88/namespacedp.html','../../'); initResizable(true
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d88/namespacedp.html">dp</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>

View File

@@ -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++: trie_operations 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d8e/namespacetrie__operations.html','../../'); init
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/d8e/namespacetrie__operations.html">trie_operations</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>

View File

@@ -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::Cache::LFUCache&lt; K, V &gt; Class Template 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -135,7 +135,7 @@ $(function(){initNavTree('df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html','..
<div class="dynheader">
Collaboration diagram for others::Cache::LFUCache&lt; K, V &gt;:</div>
<div class="dyncontent">
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d53/classothers_1_1_cache_1_1_l_f_u_cache__coll__graph.svg" width="100%" height="452"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d53/classothers_1_1_cache_1_1_l_f_u_cache__coll__graph.svg" width="100%" height="491"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></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>
@@ -208,7 +208,7 @@ class others::Cache::LFUCache&lt; K, V &gt;</div><p><a class="el" href="../../df
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -222,7 +222,7 @@ template&lt;typename K , typename V &gt; </div>
</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">
@@ -248,7 +248,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -262,7 +262,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -271,12 +271,13 @@ template&lt;typename K , typename V &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00235">235</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 235</span> {</div>
<div class="line"><span class="lineno"> 236</span> <span class="keyword">auto</span> it = <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.begin();</div>
<div class="line"><span class="lineno"> 237</span> <span class="keywordflow">while</span> (it != <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.end()) {</div>
<div class="line"><span class="lineno"> 238</span> <span class="keyword">delete</span> it-&gt;second.first;</div>
<div class="line"><span class="lineno"> 239</span> ++it;</div>
<div class="line"><span class="lineno"> 236</span> <span class="keyword">auto</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">it</a> = <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.begin();</div>
<div class="line"><span class="lineno"> 237</span> <span class="keywordflow">while</span> (<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">it</a> != <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.end()) {</div>
<div class="line"><span class="lineno"> 238</span> <span class="keyword">delete</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">it</a>-&gt;second.first;</div>
<div class="line"><span class="lineno"> 239</span> ++<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">it</a>;</div>
<div class="line"><span class="lineno"> 240</span> }</div>
<div class="line"><span class="lineno"> 241</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html"><div class="ttname"><a href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">others::Cache::LFUCache</a></div><div class="ttdoc">LFUCache.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00064">lfu_cache.cpp:64</a></div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_ac7684879e2e5da3d8bc5b1699ee42d35"><div class="ttname"><a href="#ac7684879e2e5da3d8bc5b1699ee42d35">others::Cache::LFUCache::node_map</a></div><div class="ttdeci">std::unordered_map&lt; K, std::pair&lt; CacheNode&lt; K, V &gt; *, int &gt; &gt; node_map</div><div class="ttdoc">maps the key to the node address and frequency</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00066">lfu_cache.cpp:66</a></div></div>
</div><!-- fragment -->
</div>
@@ -288,7 +289,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -302,7 +303,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -321,7 +322,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -335,7 +336,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -354,7 +355,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -368,7 +369,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -390,14 +391,14 @@ template&lt;typename K , typename V &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00202">202</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 202</span> {</div>
<div class="line"><span class="lineno"> 203</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(key)) {</div>
<div class="line"><span class="lineno"> 204</span> <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;key is not present in the cache&quot;</span>);</div>
<div class="line"><span class="lineno"> 203</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>)) {</div>
<div class="line"><span class="lineno"> 204</span> <span class="keywordflow">throw</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">std::runtime_error</a>(<span class="stringliteral">&quot;key is not present in the cache&quot;</span>);</div>
<div class="line"><span class="lineno"> 205</span> }</div>
<div class="line"><span class="lineno"> 206</span> </div>
<div class="line"><span class="lineno"> 207</span> <span class="comment">// increase the frequency and return the value</span></div>
<div class="line"><span class="lineno"> 208</span> V value = <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key].first-&gt;data.second;</div>
<div class="line"><span class="lineno"> 209</span> <a class="code hl_function" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key]);</div>
<div class="line"><span class="lineno"> 210</span> <span class="keywordflow">return</span> value;</div>
<div class="line"><span class="lineno"> 208</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">V</a> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">value</a> = <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>].first-&gt;data.second;</div>
<div class="line"><span class="lineno"> 209</span> <a class="code hl_function" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>]);</div>
<div class="line"><span class="lineno"> 210</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">value</a>;</div>
<div class="line"><span class="lineno"> 211</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_a16a25c102554c5653721a5112ef676c9"><div class="ttname"><a href="#a16a25c102554c5653721a5112ef676c9">others::Cache::LFUCache::increase_frequency</a></div><div class="ttdeci">void increase_frequency(std::pair&lt; CacheNode&lt; K, V &gt; *, int &gt; &amp;p_node)</div><div class="ttdoc">increase the frequency of node and push it in the respective list.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00109">lfu_cache.cpp:109</a></div></div>
</div><!-- fragment -->
@@ -409,7 +410,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -423,7 +424,7 @@ template&lt;typename K , typename V &gt; </div>
</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">
@@ -438,44 +439,43 @@ template&lt;typename K , typename V &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00109">109</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 109</span> {</div>
<div class="line"><span class="lineno"> 110</span> CacheNode&lt;K, V&gt; *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = p_node.first;</div>
<div class="line"><span class="lineno"> 111</span> <span class="keywordtype">int</span> freq = p_node.second;</div>
<div class="line"><span class="lineno"> 110</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a> = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p_node</a>.first;</div>
<div class="line"><span class="lineno"> 111</span> <span class="keywordtype">int</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a> = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p_node</a>.second;</div>
<div class="line"><span class="lineno"> 112</span> </div>
<div class="line"><span class="lineno"> 113</span> std::pair&lt;CacheNode&lt;K, V&gt; *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
<div class="line"><span class="lineno"> 113</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">std::pair&lt;CacheNode&lt;K, V&gt;</a> *, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *&gt; &amp;<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a> = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a>];</div>
<div class="line"><span class="lineno"> 114</span> </div>
<div class="line"><span class="lineno"> 115</span> <span class="comment">// if the given node is the only node in the list,</span></div>
<div class="line"><span class="lineno"> 116</span> <span class="comment">// then erase the frequency from map</span></div>
<div class="line"><span class="lineno"> 117</span> <span class="comment">// and increase minFreq by 1.</span></div>
<div class="line"><span class="lineno"> 118</span> <span class="keywordflow">if</span> (p.first == <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> &amp;&amp; p.second == <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
<div class="line"><span class="lineno"> 119</span> <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>.erase(freq);</div>
<div class="line"><span class="lineno"> 120</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a> == freq) {</div>
<div class="line"><span class="lineno"> 121</span> <a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a> = freq + 1;</div>
<div class="line"><span class="lineno"> 118</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first == <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a> &amp;&amp; <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.second == <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>) {</div>
<div class="line"><span class="lineno"> 119</span> <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>.erase(<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a>);</div>
<div class="line"><span class="lineno"> 120</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a> == <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a>) {</div>
<div class="line"><span class="lineno"> 121</span> <a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a> = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a> + 1;</div>
<div class="line"><span class="lineno"> 122</span> }</div>
<div class="line"><span class="lineno"> 123</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 124</span> <span class="comment">// remove the given node from current freq linked list</span></div>
<div class="line"><span class="lineno"> 125</span> CacheNode&lt;K, V&gt; *prev = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;prev;</div>
<div class="line"><span class="lineno"> 126</span> CacheNode&lt;K, V&gt; *next = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next;</div>
<div class="line"><span class="lineno"> 127</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;prev = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 128</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 125</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">prev</a> = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>-&gt;prev;</div>
<div class="line"><span class="lineno"> 126</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">next</a> = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>-&gt;next;</div>
<div class="line"><span class="lineno"> 127</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>-&gt;prev = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 128</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 129</span> </div>
<div class="line"><span class="lineno"> 130</span> <span class="keywordflow">if</span> (prev) {</div>
<div class="line"><span class="lineno"> 131</span> prev-&gt;next = next;</div>
<div class="line"><span class="lineno"> 130</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">prev</a>) {</div>
<div class="line"><span class="lineno"> 131</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">prev</a>-&gt;next = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">next</a>;</div>
<div class="line"><span class="lineno"> 132</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 133</span> p.first = next;</div>
<div class="line"><span class="lineno"> 133</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">next</a>;</div>
<div class="line"><span class="lineno"> 134</span> }</div>
<div class="line"><span class="lineno"> 135</span> </div>
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">if</span> (next) {</div>
<div class="line"><span class="lineno"> 137</span> next-&gt;prev = prev;</div>
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">next</a>) {</div>
<div class="line"><span class="lineno"> 137</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">next</a>-&gt;prev = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">prev</a>;</div>
<div class="line"><span class="lineno"> 138</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 139</span> p.second = prev;</div>
<div class="line"><span class="lineno"> 139</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.second = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">prev</a>;</div>
<div class="line"><span class="lineno"> 140</span> }</div>
<div class="line"><span class="lineno"> 141</span> }</div>
<div class="line"><span class="lineno"> 142</span> <a class="code hl_function" href="#adad4ab43141fb8ba43facd3a71e07047">push</a>(freq + 1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
<div class="line"><span class="lineno"> 143</span> ++p_node.second;</div>
<div class="line"><span class="lineno"> 142</span> <a class="code hl_function" href="#adad4ab43141fb8ba43facd3a71e07047">push</a>(<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a> + 1, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>);</div>
<div class="line"><span class="lineno"> 143</span> ++<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p_node</a>.second;</div>
<div class="line"><span class="lineno"> 144</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_aba5d59d0f6ab0c0d30a92551ca5a05f2"><div class="ttname"><a href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">others::Cache::LFUCache::freq_map</a></div><div class="ttdeci">std::unordered_map&lt; int, std::pair&lt; CacheNode&lt; K, V &gt; *, CacheNode&lt; K, V &gt; * &gt; &gt; freq_map</div><div class="ttdoc">maps the frequency to doubly linked list</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00068">lfu_cache.cpp:68</a></div></div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_adad4ab43141fb8ba43facd3a71e07047"><div class="ttname"><a href="#adad4ab43141fb8ba43facd3a71e07047">others::Cache::LFUCache::push</a></div><div class="ttdeci">void push(int freq, CacheNode&lt; K, V &gt; *node)</div><div class="ttdoc">push the node at first position in the linked list of given frequency</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00088">lfu_cache.cpp:88</a></div></div>
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -485,7 +485,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -499,7 +499,7 @@ template&lt;typename K , typename V &gt; </div>
</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">
@@ -508,22 +508,22 @@ template&lt;typename K , typename V &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00149">149</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 149</span> {</div>
<div class="line"><span class="lineno"> 150</span> std::pair&lt;CacheNode&lt;K, V&gt; *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>];</div>
<div class="line"><span class="lineno"> 150</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">std::pair&lt;CacheNode&lt;K, V&gt;</a> *, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *&gt; &amp;<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a> = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>];</div>
<div class="line"><span class="lineno"> 151</span> </div>
<div class="line"><span class="lineno"> 152</span> <span class="comment">// if there is only one node</span></div>
<div class="line"><span class="lineno"> 153</span> <span class="comment">// remove the node and erase</span></div>
<div class="line"><span class="lineno"> 154</span> <span class="comment">// the frequency from freq_map</span></div>
<div class="line"><span class="lineno"> 155</span> <span class="keywordflow">if</span> (p.first == p.second) {</div>
<div class="line"><span class="lineno"> 156</span> <span class="keyword">delete</span> p.first;</div>
<div class="line"><span class="lineno"> 155</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first == <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.second) {</div>
<div class="line"><span class="lineno"> 156</span> <span class="keyword">delete</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first;</div>
<div class="line"><span class="lineno"> 157</span> <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>.erase(<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>);</div>
<div class="line"><span class="lineno"> 158</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 159</span> }</div>
<div class="line"><span class="lineno"> 160</span> </div>
<div class="line"><span class="lineno"> 161</span> <span class="comment">// remove the last node in the linked list</span></div>
<div class="line"><span class="lineno"> 162</span> CacheNode&lt;K, V&gt; *temp = p.second;</div>
<div class="line"><span class="lineno"> 163</span> p.second = temp-&gt;prev;</div>
<div class="line"><span class="lineno"> 164</span> p.second-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 165</span> <span class="keyword">delete</span> temp;</div>
<div class="line"><span class="lineno"> 162</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">temp</a> = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.second;</div>
<div class="line"><span class="lineno"> 163</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.second = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">temp</a>-&gt;prev;</div>
<div class="line"><span class="lineno"> 164</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.second-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 165</span> <span class="keyword">delete</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">temp</a>;</div>
<div class="line"><span class="lineno"> 166</span> }</div>
</div><!-- fragment -->
</div>
@@ -534,7 +534,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -552,7 +552,7 @@ template&lt;typename K , typename V &gt; </div>
</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">
@@ -570,20 +570,19 @@ template&lt;typename K , typename V &gt; </div>
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {</div>
<div class="line"><span class="lineno"> 89</span> <span class="comment">// if freq is not present, then make a new list with node as the head as</span></div>
<div class="line"><span class="lineno"> 90</span> <span class="comment">// well as tail.</span></div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>.count(freq)) {</div>
<div class="line"><span class="lineno"> 92</span> <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq] = {<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>};</div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>.count(<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a>)) {</div>
<div class="line"><span class="lineno"> 92</span> <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a>] = {<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>};</div>
<div class="line"><span class="lineno"> 93</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 94</span> }</div>
<div class="line"><span class="lineno"> 95</span> </div>
<div class="line"><span class="lineno"> 96</span> std::pair&lt;CacheNode&lt;K, V&gt; *, CacheNode&lt;K, V&gt; *&gt; &amp;p = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[freq];</div>
<div class="line"><span class="lineno"> 96</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">std::pair&lt;CacheNode&lt;K, V&gt;</a> *, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *&gt; &amp;<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a> = <a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">freq</a>];</div>
<div class="line"><span class="lineno"> 97</span> </div>
<div class="line"><span class="lineno"> 98</span> <span class="comment">// insert the node at the beginning of the linked list and update the</span></div>
<div class="line"><span class="lineno"> 99</span> <span class="comment">// head.</span></div>
<div class="line"><span class="lineno"> 100</span> p.first-&gt;prev = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 101</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next = p.first;</div>
<div class="line"><span class="lineno"> 102</span> p.first = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 100</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first-&gt;prev = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>;</div>
<div class="line"><span class="lineno"> 101</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>-&gt;next = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first;</div>
<div class="line"><span class="lineno"> 102</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">p</a>.first = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>;</div>
<div class="line"><span class="lineno"> 103</span> }</div>
<div class="ttc" id="aavltree_8cpp_html_a74f0cf18a0e5b832d9994e2f2d022287"><div class="ttname"><a href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a></div><div class="ttdeci">struct node { int data; int height; struct node *left; struct node *right;} node</div><div class="ttdoc">for std::queue</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dee/avltree_8cpp_source.html#l00013">avltree.cpp:13</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -593,7 +592,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -611,7 +610,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -628,24 +627,24 @@ template&lt;typename K , typename V &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html#l00174">174</a> of file <a class="el" href="../../d9/d65/lfu__cache_8cpp_source.html">lfu_cache.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 174</span> {</div>
<div class="line"><span class="lineno"> 175</span> <span class="comment">// update the value if key already exists</span></div>
<div class="line"><span class="lineno"> 176</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(key)) {</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key].first-&gt;data.second = value;</div>
<div class="line"><span class="lineno"> 178</span> <a class="code hl_function" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key]);</div>
<div class="line"><span class="lineno"> 176</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.count(<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>)) {</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>].first-&gt;data.second = <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">value</a>;</div>
<div class="line"><span class="lineno"> 178</span> <a class="code hl_function" href="#a16a25c102554c5653721a5112ef676c9">increase_frequency</a>(<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>]);</div>
<div class="line"><span class="lineno"> 179</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 180</span> }</div>
<div class="line"><span class="lineno"> 181</span> </div>
<div class="line"><span class="lineno"> 182</span> <span class="comment">// if the cache is full</span></div>
<div class="line"><span class="lineno"> 183</span> <span class="comment">// remove the least frequently used item</span></div>
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.size() == <a class="code hl_variable" href="#a3acc10e6bb67d9d9c4187f625723e6c5">_capacity</a>) {</div>
<div class="line"><span class="lineno"> 185</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.erase(<a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>].second-&gt;data.first);</div>
<div class="line"><span class="lineno"> 185</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>.erase(<a class="code hl_variable" href="#aba5d59d0f6ab0c0d30a92551ca5a05f2">freq_map</a>[<a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a>].<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">second</a>-&gt;data.first);</div>
<div class="line"><span class="lineno"> 186</span> <a class="code hl_function" href="#ab3561ab204754295199f9566924f7e69">pop</a>();</div>
<div class="line"><span class="lineno"> 187</span> }</div>
<div class="line"><span class="lineno"> 188</span> </div>
<div class="line"><span class="lineno"> 189</span> <span class="comment">// insert the new node and set minFreq to 1</span></div>
<div class="line"><span class="lineno"> 190</span> CacheNode&lt;K, V&gt; *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> CacheNode&lt;K, V&gt;({key, value});</div>
<div class="line"><span class="lineno"> 191</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[key] = {<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, 1};</div>
<div class="line"><span class="lineno"> 190</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a> *<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">CacheNode&lt;K, V&gt;</a>({<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">value</a>});</div>
<div class="line"><span class="lineno"> 191</span> <a class="code hl_variable" href="#ac7684879e2e5da3d8bc5b1699ee42d35">node_map</a>[<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">key</a>] = {<a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>, 1};</div>
<div class="line"><span class="lineno"> 192</span> <a class="code hl_variable" href="#a6de844d1589a809239cc07752f311285">minFreq</a> = 1;</div>
<div class="line"><span class="lineno"> 193</span> <a class="code hl_function" href="#adad4ab43141fb8ba43facd3a71e07047">push</a>(1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
<div class="line"><span class="lineno"> 193</span> <a class="code hl_function" href="#adad4ab43141fb8ba43facd3a71e07047">push</a>(1, <a class="code hl_class" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">node</a>);</div>
<div class="line"><span class="lineno"> 194</span> }</div>
<div class="ttc" id="aclassothers_1_1_cache_1_1_l_f_u_cache_html_ab3561ab204754295199f9566924f7e69"><div class="ttname"><a href="#ab3561ab204754295199f9566924f7e69">others::Cache::LFUCache::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdoc">pop the last node in the least frequently used linked list</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d65/lfu__cache_8cpp_source.html#l00149">lfu_cache.cpp:149</a></div></div>
</div><!-- fragment -->
@@ -657,7 +656,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -671,7 +670,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -691,7 +690,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -702,7 +701,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -719,7 +718,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -730,7 +729,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -747,7 +746,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -758,7 +757,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -775,7 +774,7 @@ template&lt;typename K , typename V &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K , typename V &gt; </div>
template&lt;typename K, typename V&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -786,7 +785,7 @@ template&lt;typename K , typename V &gt; </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">
@@ -806,7 +805,7 @@ template&lt;typename K , typename V &gt; </div>
<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"><a class="el" href="../../db/dde/namespaceothers_1_1_cache.html">Cache</a></li><li class="navelem"><a class="el" href="../../df/d8f/classothers_1_1_cache_1_1_l_f_u_cache.html">LFUCache</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>

View File

@@ -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: backtracking/wildcard_matching.cpp Pages: 1 -->
<svg width="252pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -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: backtracking/wildcard_matching.cpp Pages: 1 -->
<svg width="252pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -140,7 +140,7 @@ $(function(){initNavTree('dd/d1c/classhash__chain.html','../../'); initResizable
<!-- 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>

View File

@@ -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++: backtracking/subarray_sum.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -244,13 +244,12 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 52</span> }</div>
<div class="line"><span class="lineno"> 53</span> <span class="comment">// If in case current_sum is greater than the required sum</span></div>
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (sumarray.find(current_sum - sum) != sumarray.end()) {</div>
<div class="line"><span class="lineno"> 55</span> count_of_subset += (sumarray[current_sum - <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>]);</div>
<div class="line"><span class="lineno"> 55</span> count_of_subset += (sumarray[current_sum - sum]);</div>
<div class="line"><span class="lineno"> 56</span> }</div>
<div class="line"><span class="lineno"> 57</span> sumarray[current_sum]++;</div>
<div class="line"><span class="lineno"> 58</span> }</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> count_of_subset;</div>
<div class="line"><span class="lineno"> 60</span>}</div>
<div class="ttc" id="anamespacemachine__learning_html_a6f1c98c016ad34ff3d9f39372161bd35"><div class="ttname"><a href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">machine_learning::sum</a></div><div class="ttdeci">T sum(const std::vector&lt; std::valarray&lt; T &gt; &gt; &amp;A)</div><div class="ttdef"><b>Definition</b> <a href="../../d8/d95/vector__ops_8hpp_source.html#l00232">vector_ops.hpp:232</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -272,7 +271,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">
@@ -286,7 +285,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 70</span> std::cout &lt;&lt; <span class="stringliteral">&quot;1st test &quot;</span>;</div>
<div class="line"><span class="lineno"> 71</span> std::vector&lt;int64_t&gt; array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
<div class="line"><span class="lineno"> 72</span> assert(</div>
<div class="line"><span class="lineno"> 73</span> backtracking::subarray_sum::subarray_sum(0, array1) ==</div>
<div class="line"><span class="lineno"> 73</span> <a class="code hl_function" href="#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(0, array1) ==</div>
<div class="line"><span class="lineno"> 74</span> 1); <span class="comment">// first argument in subarray_sum function is the required sum and</span></div>
<div class="line"><span class="lineno"> 75</span> <span class="comment">// second is the input array, answer is the subarray {(-3,-2,5)}</span></div>
<div class="line"><span class="lineno"> 76</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -294,7 +293,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 78</span> <span class="comment">// 2nd test</span></div>
<div class="line"><span class="lineno"> 79</span> std::cout &lt;&lt; <span class="stringliteral">&quot;2nd test &quot;</span>;</div>
<div class="line"><span class="lineno"> 80</span> std::vector&lt;int64_t&gt; array2 = {1, 2, 3, 3};</div>
<div class="line"><span class="lineno"> 81</span> assert(backtracking::subarray_sum::subarray_sum(6, array2) ==</div>
<div class="line"><span class="lineno"> 81</span> assert(<a class="code hl_function" href="#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(6, array2) ==</div>
<div class="line"><span class="lineno"> 82</span> 2); <span class="comment">// here we are expecting 2 subsets which sum up to 6 i.e.</span></div>
<div class="line"><span class="lineno"> 83</span> <span class="comment">// {(1,2,3),(3,3)}</span></div>
<div class="line"><span class="lineno"> 84</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -302,7 +301,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 86</span> <span class="comment">// 3rd test</span></div>
<div class="line"><span class="lineno"> 87</span> std::cout &lt;&lt; <span class="stringliteral">&quot;3rd test &quot;</span>;</div>
<div class="line"><span class="lineno"> 88</span> std::vector&lt;int64_t&gt; array3 = {1, 1, 1, 1};</div>
<div class="line"><span class="lineno"> 89</span> assert(backtracking::subarray_sum::subarray_sum(1, array3) ==</div>
<div class="line"><span class="lineno"> 89</span> assert(<a class="code hl_function" href="#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(1, array3) ==</div>
<div class="line"><span class="lineno"> 90</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
<div class="line"><span class="lineno"> 91</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
<div class="line"><span class="lineno"> 92</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -310,7 +309,7 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 94</span> <span class="comment">// 4rd test</span></div>
<div class="line"><span class="lineno"> 95</span> std::cout &lt;&lt; <span class="stringliteral">&quot;4th test &quot;</span>;</div>
<div class="line"><span class="lineno"> 96</span> std::vector&lt;int64_t&gt; array4 = {3, 3, 3, 3};</div>
<div class="line"><span class="lineno"> 97</span> assert(backtracking::subarray_sum::subarray_sum(6, array4) ==</div>
<div class="line"><span class="lineno"> 97</span> assert(<a class="code hl_function" href="#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(6, array4) ==</div>
<div class="line"><span class="lineno"> 98</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
<div class="line"><span class="lineno"> 99</span> <span class="comment">// {(3,3),(3,3),(3,3)}</span></div>
<div class="line"><span class="lineno"> 100</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -318,11 +317,12 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 102</span> <span class="comment">// 5th test</span></div>
<div class="line"><span class="lineno"> 103</span> std::cout &lt;&lt; <span class="stringliteral">&quot;5th test &quot;</span>;</div>
<div class="line"><span class="lineno"> 104</span> std::vector&lt;int64_t&gt; array5 = {};</div>
<div class="line"><span class="lineno"> 105</span> assert(backtracking::subarray_sum::subarray_sum(6, array5) ==</div>
<div class="line"><span class="lineno"> 105</span> assert(<a class="code hl_function" href="#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(6, array5) ==</div>
<div class="line"><span class="lineno"> 106</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
<div class="line"><span class="lineno"> 107</span> <span class="comment">// cannot select anything from an empty array</span></div>
<div class="line"><span class="lineno"> 108</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 109</span>}</div>
<div class="ttc" id="asubarray__sum_8cpp_html_af5687bbd9faf927fbd363c71e0baba5e"><div class="ttname"><a href="#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a></div><div class="ttdeci">uint64_t subarray_sum(int64_t sum, const std::vector&lt; int64_t &gt; &amp;in_arr)</div><div class="ttdoc">The main function that implements the count of the subarrays.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d94/subarray__sum_8cpp_source.html#l00039">subarray_sum.cpp:39</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -332,7 +332,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_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../df/d94/subarray__sum_8cpp.html">subarray_sum.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>

View File

@@ -1,6 +1,6 @@
var subarray__sum_8cpp =
[
[ "main", "df/d94/subarray__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "subarray_sum", "df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e", null ],
[ "backtracking::subarray_sum::subarray_sum", "df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e", null ],
[ "test", "df/d94/subarray__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
];

View File

@@ -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++: backtracking/subarray_sum.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,13 +124,14 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
<div class="headertitle"><div class="title">subarray_sum.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d94/subarray__sum_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="../../df/d94/subarray__sum_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="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include &lt;unordered_map&gt;</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include &lt;vector&gt;</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="../../db/dc0/namespacebacktracking.html">backtracking</a> {</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="../../df/d74/namespacesubarray__sum.html">subarray_sum</a> {</div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
@@ -159,14 +160,14 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>} <span class="comment">// namespace subarray_sum</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>} <span class="comment">// namespace backtracking</span></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="../../df/d94/subarray__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 68</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// 1st test</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> std::cout &lt;&lt; <span class="stringliteral">&quot;1st test &quot;</span>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> std::vector&lt;int64_t&gt; array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> assert(</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> backtracking::subarray_sum::subarray_sum(0, array1) ==</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(0, array1) ==</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> 1); <span class="comment">// first argument in subarray_sum function is the required sum and</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// second is the input array, answer is the subarray {(-3,-2,5)}</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -174,7 +175,7 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// 2nd test</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::cout &lt;&lt; <span class="stringliteral">&quot;2nd test &quot;</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::vector&lt;int64_t&gt; array2 = {1, 2, 3, 3};</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> assert(backtracking::subarray_sum::subarray_sum(6, array2) ==</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> assert(<a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(6, array2) ==</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> 2); <span class="comment">// here we are expecting 2 subsets which sum up to 6 i.e.</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// {(1,2,3),(3,3)}</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -182,7 +183,7 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// 3rd test</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> std::cout &lt;&lt; <span class="stringliteral">&quot;3rd test &quot;</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> std::vector&lt;int64_t&gt; array3 = {1, 1, 1, 1};</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> assert(backtracking::subarray_sum::subarray_sum(1, array3) ==</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> assert(<a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(1, array3) ==</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -190,7 +191,7 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// 4rd test</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::cout &lt;&lt; <span class="stringliteral">&quot;4th test &quot;</span>;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::vector&lt;int64_t&gt; array4 = {3, 3, 3, 3};</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(backtracking::subarray_sum::subarray_sum(6, array4) ==</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(<a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(6, array4) ==</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// {(3,3),(3,3),(3,3)}</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
@@ -198,13 +199,13 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// 5th test</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::cout &lt;&lt; <span class="stringliteral">&quot;5th test &quot;</span>;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::vector&lt;int64_t&gt; array5 = {};</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> assert(backtracking::subarray_sum::subarray_sum(6, array5) ==</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> assert(<a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a>(6, array5) ==</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">// cannot select anything from an empty array</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::cout &lt;&lt; <span class="stringliteral">&quot;passed&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span>}</div>
</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span></div>
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="../../df/d94/subarray__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 115</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_function" href="../../df/d94/subarray__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -215,13 +216,14 @@ $(function(){initNavTree('df/d94/subarray__sum_8cpp_source.html','../../'); init
<div class="ttc" id="anamespacesubarray__sum_html"><div class="ttname"><a href="../../df/d74/namespacesubarray__sum.html">subarray_sum</a></div><div class="ttdoc">Functions for the Subset sum implementation.</div></div>
<div class="ttc" id="asubarray__sum_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d94/subarray__sum_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="#l00068">subarray_sum.cpp:68</a></div></div>
<div class="ttc" id="asubarray__sum_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/d94/subarray__sum_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="#l00115">subarray_sum.cpp:115</a></div></div>
<div class="ttc" id="asubarray__sum_8cpp_html_af5687bbd9faf927fbd363c71e0baba5e"><div class="ttname"><a href="../../df/d94/subarray__sum_8cpp.html#af5687bbd9faf927fbd363c71e0baba5e">backtracking::subarray_sum::subarray_sum</a></div><div class="ttdeci">uint64_t subarray_sum(int64_t sum, const std::vector&lt; int64_t &gt; &amp;in_arr)</div><div class="ttdoc">The main function that implements the count of the subarrays.</div><div class="ttdef"><b>Definition</b> <a href="#l00039">subarray_sum.cpp:39</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_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../df/d94/subarray__sum_8cpp.html">subarray_sum.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>

View File

@@ -0,0 +1,148 @@
<!-- 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++: Member List</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">&#160;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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;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&amp;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&amp;dn=expat.txt MIT */
$(function(){initNavTree('dc/d02/classstats__computer2.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="headertitle"><div class="title">stats_computer2&lt; T &gt; Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>M</b> (defined in <a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a>)</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html#a8290966ad468f2a8c266d008bc60720e">mean</a>() const</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>mu</b> (defined in <a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a>)</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>n</b> (defined in <a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a>)</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html#ade6de704deea24fdc88077b3d9a0d534">new_val</a>(T x)</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html#ab444d485c9e7db35bdc2ff6b7775291a">operator&gt;&gt;</a>(std::istream &amp;input, stats_computer2 &amp;stat)</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html#acf2e84df4fc386bb3295016ef8fd156e">std</a>() const</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="odd"><td class="entry"><b>var</b> (defined in <a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a>)</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html#af6198817084276113b3c064e87ce0555">variance</a>() const</td><td class="entry"><a class="el" href="../../dc/d02/classstats__computer2.html">stats_computer2&lt; T &gt;</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- 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.13.2 </li>
</ul>
</div>
</body>
</html>

View File

@@ -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/cll/main_cll.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -176,7 +176,7 @@ $(function(){initNavTree('df/d97/main__cll_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_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../dir_f1797d0c2a0a12033e7d74efffeb14e1.html">cll</a></li><li class="navelem"><b>main_cll.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>

View File

@@ -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++: std::is_unsigned&lt; uint256_t &gt; 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -146,7 +146,7 @@ Collaboration diagram for std::is_unsigned&lt; uint256_t &gt;:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>std</b></li><li class="navelem"><a class="el" href="../../df/d99/structstd_1_1is__unsigned_3_01uint256__t_01_4.html">is_unsigned&lt; uint256_t &gt;</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>

View File

@@ -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_array2.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -188,7 +188,7 @@ $(function(){initNavTree('df/da7/queue__using__array2_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"><b>queue_using_array2.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>

View File

@@ -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/quadratic_equations_complex_numbers.cpp Pages: 1 -->
<svg width="460pt" height="94pt"

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -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/quadratic_equations_complex_numbers.cpp Pages: 1 -->
<svg width="460pt" height="94pt"

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -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::is_graph_bipartite::Graph Pages: 1 -->
<svg width="236pt" height="116pt"

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -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::is_graph_bipartite::Graph Pages: 1 -->
<svg width="236pt" height="116pt"

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -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/travelling_salesman_using_bit_manipulation.cpp Pages: 1 -->
<svg width="382pt" height="94pt"

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -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/travelling_salesman_using_bit_manipulation.cpp Pages: 1 -->
<svg width="382pt" height="94pt"

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -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/successive_approximation.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -171,7 +171,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">
@@ -202,7 +202,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">
@@ -265,7 +265,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_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../df/dc8/successive__approximation_8cpp.html">successive_approximation.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>

View File

@@ -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/successive_approximation.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,14 +124,14 @@ $(function(){initNavTree('df/dc8/successive__approximation_8cpp_source.html','..
<div class="headertitle"><div class="title">successive_approximation.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/dc8/successive__approximation_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="../../df/dc8/successive__approximation_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="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="../../df/dc8/successive__approximation_8cpp.html#a79c1d08919ff7780a5d7723172602389"> 12</a></span><span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code hl_function" href="../../df/dc8/successive__approximation_8cpp.html#a79c1d08919ff7780a5d7723172602389">eq</a>(<span class="keywordtype">float</span> y) { <span class="keywordflow">return</span> (3 * y) - cos(y) - 2; }</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="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="../../df/dc8/successive__approximation_8cpp.html#ae89c36add7c55298c5195d0a83de1456"> 17</a></span><span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code hl_function" href="../../df/dc8/successive__approximation_8cpp.html#ae89c36add7c55298c5195d0a83de1456">eqd</a>(<span class="keywordtype">float</span> y) { <span class="keywordflow">return</span> 0.5 * (cos(y) + 2); }</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="foldopen" id="foldopen00020" data-start="{" data-end="}">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../df/dc8/successive__approximation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 20</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/dc8/successive__approximation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">float</span> y, x1, x2, x3, sum, s, a, f1, f2, gd;</div>
@@ -164,7 +164,7 @@ $(function(){initNavTree('df/dc8/successive__approximation_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="../../df/dc8/successive__approximation_8cpp.html">successive_approximation.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>

View File

@@ -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++: strings 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -148,7 +148,7 @@ Namespaces</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../df/dcb/namespacestrings.html">strings</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>

View File

@@ -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/quadratic_equations_complex_numbers.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -128,7 +128,8 @@ $(function(){initNavTree('df/dcd/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
<p>array&lt;complex&lt;long double, 2&gt; solutions = quadraticEquation(1, 2, 1); cout &lt;&lt; solutions[0] &lt;&lt; " " &lt;&lt; solutions[1] &lt;&lt; "\n";</p>
<p>solutions = quadraticEquation(1, 1, 1); // Reusing solutions. cout &lt;&lt; solutions[0] &lt;&lt; " " &lt;&lt; solutions[1] &lt;&lt; "\n"; return 0; }</p>
<p>Output: (-1, 0) (-1, 0) (-0.5,0.866025) (-0.5,0.866025)</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 &lt;array&gt;</span> </div>
<div class="line"><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><span class="preprocessor">#include &lt;cmath&gt;</span> </div>
@@ -136,9 +137,9 @@ $(function(){initNavTree('df/dcd/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
<div class="line"><span class="preprocessor">#include &lt;exception&gt;</span> </div>
<div class="line"><span class="preprocessor">#include &lt;iomanip&gt;</span> </div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</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">std::array&lt;std::complex&lt;long double&gt;, 2&gt; <a id="a0" name="a0"></a><a class="code hl_function" href="../../dd/d47/namespacemath.html#aacb1411ef2029e81f249c21e17c96fdb">quadraticEquation</a>(<span class="keywordtype">long</span> <span class="keywordtype">double</span> a,</div>
<div class="line"> <span class="keywordtype">long</span> <span class="keywordtype">double</span> b,</div>
<div class="line"> <span class="keywordtype">long</span> <span class="keywordtype">double</span> c) {</div>
@@ -179,7 +180,7 @@ $(function(){initNavTree('df/dcd/_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="keywordtype">void</span> <a id="a1" name="a1"></a><a class="code hl_function" href="../../da/d18/quadratic__equations__complex__numbers_8cpp.html#af7a6d4e3dc85a6288c8f1f7094830c5a">assertArray</a>(std::array&lt;std::complex&lt;long double&gt;, 2&gt; input,</div>
<div class="line"> std::array&lt;std::complex&lt;long double&gt;, 2&gt; expected,</div>
<div class="line"> <span class="keywordtype">size_t</span> precision = 10) {</div>
@@ -196,7 +197,7 @@ $(function(){initNavTree('df/dcd/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
<div class="line"> </div>
<div class="line"> assert(input == expected);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> <a id="a2" name="a2"></a><a class="code hl_function" href="../../dd/d1e/generate__parentheses_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"> <span class="comment">// Values are equal and real.</span></div>
<div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Input: \n&quot;</span></div>
@@ -256,7 +257,7 @@ $(function(){initNavTree('df/dcd/_2_users_2runner_2work_2_c-_plus-_plus_2_c-_plu
<div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Exception thrown successfully \n&quot;</span>;</div>
<div class="line"> }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> <a id="a3" name="a3"></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>
@@ -271,7 +272,7 @@ $(function(){initNavTree('df/dcd/_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>

View File

@@ -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: greedy_algorithms::dijkstra::Graph Pages: 1 -->
<svg width="126pt" height="116pt"

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -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: greedy_algorithms::dijkstra::Graph Pages: 1 -->
<svg width="126pt" height="116pt"

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -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++: graph 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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -491,24 +491,24 @@ Functions</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../d8/d68/dijkstra_8cpp_source.html#l00066">66</a> of file <a class="el" href="../../d8/d68/dijkstra_8cpp_source.html">dijkstra.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 66</span> {</div>
<div class="line"><span class="lineno"> 68</span> <span class="keywordtype">int</span> n = adj-&gt;size();</div>
<div class="line"><span class="lineno"> 69</span> </div>
<div class="line"><span class="lineno"> 71</span> std::vector&lt;int64_t&gt; dist(n, INF);</div>
<div class="line"><span class="lineno"> 72</span> </div>
<div class="line"><span class="lineno"> 69</span></div>
<div class="line"><span class="lineno"> 71</span> std::vector&lt;int64_t&gt; dist(n, <a class="code hl_variable" href="../../d7/d07/bidirectional__dijkstra_8cpp.html#a330a2b0a904f01802ada1f8f3b28e76c">INF</a>);</div>
<div class="line"><span class="lineno"> 72</span></div>
<div class="line"><span class="lineno"> 76</span> std::priority_queue&lt;std::pair&lt;int, int&gt;, std::vector&lt;std::pair&lt;int, int&gt;&gt;,</div>
<div class="line"><span class="lineno"> 77</span> std::greater&lt;std::pair&lt;int, int&gt;&gt;&gt;</div>
<div class="line"><span class="lineno"> 78</span> pq;</div>
<div class="line"><span class="lineno"> 79</span> </div>
<div class="line"><span class="lineno"> 79</span></div>
<div class="line"><span class="lineno"> 81</span> pq.push(std::make_pair(0, s));</div>
<div class="line"><span class="lineno"> 82</span> </div>
<div class="line"><span class="lineno"> 82</span></div>
<div class="line"><span class="lineno"> 84</span> dist[s] = 0;</div>
<div class="line"><span class="lineno"> 85</span> </div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">while</span> (!pq.empty()) {</div>
<div class="line"><span class="lineno"> 88</span> <span class="keywordtype">int</span> currentNode = pq.top().second;</div>
<div class="line"><span class="lineno"> 89</span> </div>
<div class="line"><span class="lineno"> 89</span></div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordtype">int</span> currentDist = pq.top().first;</div>
<div class="line"><span class="lineno"> 92</span> </div>
<div class="line"><span class="lineno"> 93</span> pq.pop();</div>
<div class="line"><span class="lineno"> 94</span> </div>
<div class="line"><span class="lineno"> 94</span></div>
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">for</span> (std::pair&lt;int, int&gt; edge : (*adj)[currentNode]) {</div>
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">if</span> (currentDist + edge.second &lt; dist[edge.first]) {</div>
<div class="line"><span class="lineno"> 100</span> dist[edge.first] = currentDist + edge.second;</div>
@@ -516,11 +516,12 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 102</span> }</div>
<div class="line"><span class="lineno"> 103</span> }</div>
<div class="line"><span class="lineno"> 104</span> }</div>
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">if</span> (dist[t] != INF) {</div>
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">if</span> (dist[t] != <a class="code hl_variable" href="../../d7/d07/bidirectional__dijkstra_8cpp.html#a330a2b0a904f01802ada1f8f3b28e76c">INF</a>) {</div>
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">return</span> dist[t];</div>
<div class="line"><span class="lineno"> 107</span> }</div>
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">return</span> -1;</div>
<div class="line"><span class="lineno"> 109</span>}</div>
<div class="ttc" id="abidirectional__dijkstra_8cpp_html_a330a2b0a904f01802ada1f8f3b28e76c"><div class="ttname"><a href="../../d7/d07/bidirectional__dijkstra_8cpp.html#a330a2b0a904f01802ada1f8f3b28e76c">INF</a></div><div class="ttdeci">constexpr int64_t INF</div><div class="ttdoc">for assert</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d07/bidirectional__dijkstra_8cpp_source.html#l00024">bidirectional_dijkstra.cpp:24</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -745,18 +746,18 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 47</span> vtx.push_back(i);</div>
<div class="line"><span class="lineno"> 48</span> }</div>
<div class="line"><span class="lineno"> 49</span> }</div>
<div class="line"><span class="lineno"> 50</span> </div>
<div class="line"><span class="lineno"> 50</span></div>
<div class="line"><span class="lineno"> 52</span> int32_t min_path = 2147483647;</div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">do</span> {</div>
<div class="line"><span class="lineno"> 55</span> int32_t curr_weight = 0;</div>
<div class="line"><span class="lineno"> 56</span> </div>
<div class="line"><span class="lineno"> 56</span></div>
<div class="line"><span class="lineno"> 58</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = src;</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i : vtx) {</div>
<div class="line"><span class="lineno"> 60</span> curr_weight += (*cities)[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][i];</div>
<div class="line"><span class="lineno"> 61</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = i;</div>
<div class="line"><span class="lineno"> 62</span> }</div>
<div class="line"><span class="lineno"> 63</span> curr_weight += (*cities)[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][src];</div>
<div class="line"><span class="lineno"> 64</span> </div>
<div class="line"><span class="lineno"> 64</span></div>
<div class="line"><span class="lineno"> 66</span> min_path = std::min(min_path, curr_weight);</div>
<div class="line"><span class="lineno"> 67</span> </div>
<div class="line"><span class="lineno"> 68</span> } <span class="keywordflow">while</span> (next_permutation(vtx.begin(), vtx.end()));</div>
@@ -773,7 +774,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="../../df/dce/namespacegraph.html">graph</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>

View File

@@ -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_two_stacks.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -237,7 +237,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_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../df/dd0/queue__using__two__stacks_8cpp.html">queue_using_two_stacks.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>

View File

@@ -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_two_stacks.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -124,7 +124,8 @@ $(function(){initNavTree('df/dd0/queue__using__two__stacks_8cpp_source.html','..
<div class="headertitle"><div class="title">queue_using_two_stacks.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/dd0/queue__using__two__stacks_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="../../df/dd0/queue__using__two__stacks_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 &lt;cassert&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;stack&gt;</span></div>
@@ -137,16 +138,16 @@ $(function(){initNavTree('df/dd0/queue__using__two__stacks_8cpp_source.html','..
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> MyQueue() = <span class="keywordflow">default</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="keywordtype">void</span> push(T x);</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">const</span> T&amp; pop();</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">const</span> T&amp; peek() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">bool</span> empty() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span>};</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keywordtype">void</span> MyQueue&lt;T&gt;::push(T x) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">while</span> (!s2.empty()) {</div>
@@ -159,14 +160,14 @@ $(function(){initNavTree('df/dd0/queue__using__two__stacks_8cpp_source.html','..
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> s1.pop();</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> }</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>}</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="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="keyword">const</span> T&amp; MyQueue&lt;T&gt;::pop() {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">const</span> T&amp; temp = MyQueue::peek();</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> s2.pop();</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> temp;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span>}</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="keyword">const</span> T&amp; MyQueue&lt;T&gt;::peek()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">if</span> (!empty()) {</div>
@@ -175,13 +176,13 @@ $(function(){initNavTree('df/dd0/queue__using__two__stacks_8cpp_source.html','..
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::cerr &lt;&lt; <span class="stringliteral">&quot;Queue is empty&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> exit(0);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span>}</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="keywordtype">bool</span> MyQueue&lt;T&gt;::empty()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> s2.empty() &amp;&amp; s1.empty();</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>}</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>} <span class="comment">// namespace</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</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="../../df/dd0/queue__using__two__stacks_8cpp.html#a831ded10ecad88c14a8e22b96f4c1863"> 101</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../df/dd0/queue__using__two__stacks_8cpp.html#a831ded10ecad88c14a8e22b96f4c1863">queue_test</a>() {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> MyQueue&lt;int&gt; que;</div>
@@ -220,7 +221,7 @@ $(function(){initNavTree('df/dd0/queue__using__two__stacks_8cpp_source.html','..
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> std::cout &lt;&lt; <span class="stringliteral">&quot;PASSED\n&quot;</span>;</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="foldopen00141" data-start="{" data-end="}">
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="../../df/dd0/queue__using__two__stacks_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 141</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/dd0/queue__using__two__stacks_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_function" href="../../df/dd0/queue__using__two__stacks_8cpp.html#a831ded10ecad88c14a8e22b96f4c1863">queue_test</a>();</div>
@@ -235,7 +236,7 @@ $(function(){initNavTree('df/dd0/queue__using__two__stacks_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="../../df/dd0/queue__using__two__stacks_8cpp.html">queue_using_two_stacks.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>

View File

@@ -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: physics/ground_to_ground_projectile_motion.cpp Pages: 1 -->
<svg width="189pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -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: physics/ground_to_ground_projectile_motion.cpp Pages: 1 -->
<svg width="189pt" height="94pt"

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -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/stairs_pattern.cpp Pages: 1 -->
<svg width="132pt" height="83pt"

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -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/stairs_pattern.cpp Pages: 1 -->
<svg width="132pt" height="83pt"

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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++: search/binary_search.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&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -252,7 +252,7 @@ $(function(){initNavTree('df/dd5/binary__search_8cpp_source.html','../../'); ini
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="comment"> * @brief Self-test implementation #3</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="comment"> * @returns void</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="comment"> *******************************************************************************/</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/db0/adaline__learning_8cpp.html#a992bdf1fdb0b9d414bcf7981d2d87aa9">test3</a>() {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d0c/hamiltons__cycle_8cpp.html#a0cc94918b6831f308d4fe4fa27f08299">test3</a>() {</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="comment">// testcase #3</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="comment">// array = [1,31,231,12,12,2,5,51,21,23,12,3] , Value = 5</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// should return 8</span></div>
@@ -272,12 +272,12 @@ $(function(){initNavTree('df/dd5/binary__search_8cpp_source.html','../../'); ini
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</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="l00145" name="l00145"></a><span class="lineno"> 145</span> <a class="code hl_function" href="../../d7/db9/hill__cipher_8cpp.html#a3147ad576f8a94a2a6b66948672b452b">test1</a>(); <span class="comment">// run self-test implementation #1</span></div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_function" href="../../d7/db9/hill__cipher_8cpp.html#a04391124480d2a49f2dec900237b0712">test2</a>(); <span class="comment">// run self-test implementation #2</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_function" href="../../d5/db0/adaline__learning_8cpp.html#a992bdf1fdb0b9d414bcf7981d2d87aa9">test3</a>(); <span class="comment">// run self-test implementation #3</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_function" href="../../dd/d0c/hamiltons__cycle_8cpp.html#a0cc94918b6831f308d4fe4fa27f08299">test3</a>(); <span class="comment">// run self-test implementation #3</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span>}</div>
<div class="ttc" id="aadaline__learning_8cpp_html_a992bdf1fdb0b9d414bcf7981d2d87aa9"><div class="ttname"><a href="../../d5/db0/adaline__learning_8cpp.html#a992bdf1fdb0b9d414bcf7981d2d87aa9">test3</a></div><div class="ttdeci">void test3(double eta=0.01)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/db0/adaline__learning_8cpp_source.html#l00313">adaline_learning.cpp:313</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="ahamiltons__cycle_8cpp_html_a0cc94918b6831f308d4fe4fa27f08299"><div class="ttname"><a href="../../dd/d0c/hamiltons__cycle_8cpp.html#a0cc94918b6831f308d4fe4fa27f08299">test3</a></div><div class="ttdeci">static void test3()</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d0c/hamiltons__cycle_8cpp_source.html#l00122">hamiltons_cycle.cpp:122</a></div></div>
<div class="ttc" id="ahill__cipher_8cpp_html_a04391124480d2a49f2dec900237b0712"><div class="ttname"><a href="../../d7/db9/hill__cipher_8cpp.html#a04391124480d2a49f2dec900237b0712">test2</a></div><div class="ttdeci">void test2(const std::string &amp;text)</div><div class="ttdoc">Self test 2 - using 8x8 randomly generated key.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/db9/hill__cipher_8cpp_source.html#l00506">hill_cipher.cpp:506</a></div></div>
<div class="ttc" id="ahill__cipher_8cpp_html_a3147ad576f8a94a2a6b66948672b452b"><div class="ttname"><a href="../../d7/db9/hill__cipher_8cpp.html#a3147ad576f8a94a2a6b66948672b452b">test1</a></div><div class="ttdeci">void test1(const std::string &amp;text)</div><div class="ttdoc">Self test 1 - using 3x3 randomly generated key.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/db9/hill__cipher_8cpp_source.html#l00471">hill_cipher.cpp:471</a></div></div>
<div class="ttc" id="anamespacesearch_html"><div class="ttname"><a href="../../d9/dca/namespacesearch.html">search</a></div><div class="ttdoc">for std::assert</div><div class="ttdef"><b>Definition</b> <a href="#l00047">binary_search.cpp:47</a></div></div>
@@ -287,7 +287,7 @@ $(function(){initNavTree('df/dd5/binary__search_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_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><b>binary_search.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>

View File

@@ -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: ciphers/a1z26_cipher.cpp Pages: 1 -->
<!--zoomable 83 -->

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -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: ciphers/a1z26_cipher.cpp Pages: 1 -->
<svg width="506pt" height="83pt"

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Some files were not shown because too many files have changed in this diff Show More