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

@@ -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++: horspool 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('d5/d02/namespacehorspool.html','../../'); initResizabl
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d02/namespacehorspool.html">horspool</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::Graph&lt; T &gt; Pages: 1 -->
<svg width="250pt" height="183pt"

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::Graph&lt; T &gt; Pages: 1 -->
<svg width="250pt" height="183pt"

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::trie_using_hashmap::Trie::Node 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');
@@ -193,7 +193,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><b>trie_using_hashmap</b></li><li class="navelem"><a class="el" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html">Trie</a></li><li class="navelem"><a class="el" href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html">Node</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.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++: cll 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');
@@ -228,7 +228,7 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 19</span> cout &lt;&lt; <span class="stringliteral">&quot;List is empty !&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"> 20</span> <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 21</span> cout &lt;&lt; <span class="stringliteral">&quot;CLL list: &quot;</span>;</div>
<div class="line"><span class="lineno"> 22</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 22</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 23</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; total; i++) {</div>
<div class="line"><span class="lineno"> 24</span> cout &lt;&lt; current-&gt;data &lt;&lt; <span class="stringliteral">&quot; -&gt; &quot;</span>;</div>
<div class="line"><span class="lineno"> 25</span> current = current-&gt;next;</div>
@@ -237,8 +237,8 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 28</span> cout &lt;&lt; <span class="stringliteral">&quot;Total element: &quot;</span> &lt;&lt; total &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><span class="lineno"> 29</span> }</div>
<div class="line"><span class="lineno"> 30</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 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>
<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>
@@ -263,7 +263,7 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 80</span> cout &lt;&lt; <span class="stringliteral">&quot;List is empty !&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"> 81</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 82</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 83</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 83</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordflow">while</span> (current-&gt;next != head) {</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">if</span> (current-&gt;data == item_to_find)</div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
@@ -312,7 +312,7 @@ Protected Attributes</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../d1/d70/cll_8cpp_source.html#l00033">33</a> of file <a class="el" href="../../d1/d70/cll_8cpp_source.html">cll.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 33</span> {</div>
<div class="line"><span class="lineno"> 34</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *newNode;</div>
<div class="line"><span class="lineno"> 34</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *newNode;</div>
<div class="line"><span class="lineno"> 35</span> newNode = <span class="keyword">new</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 36</span> newNode-&gt;data = new_data;</div>
<div class="line"><span class="lineno"> 37</span> newNode-&gt;next = NULL;</div>
@@ -320,7 +320,7 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 39</span> head = newNode;</div>
<div class="line"><span class="lineno"> 40</span> head-&gt;next = head;</div>
<div class="line"><span class="lineno"> 41</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 42</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 42</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">while</span> (current-&gt;next != head) {</div>
<div class="line"><span class="lineno"> 44</span> current = current-&gt;next;</div>
<div class="line"><span class="lineno"> 45</span> }</div>
@@ -330,7 +330,6 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 49</span> }</div>
<div class="line"><span class="lineno"> 50</span> total++;</div>
<div class="line"><span class="lineno"> 51</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>
@@ -351,7 +350,7 @@ Protected Attributes</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../d1/d70/cll_8cpp_source.html#l00054">54</a> of file <a class="el" href="../../d1/d70/cll_8cpp_source.html">cll.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 54</span> {</div>
<div class="line"><span class="lineno"> 55</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *newNode;</div>
<div class="line"><span class="lineno"> 55</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *newNode;</div>
<div class="line"><span class="lineno"> 56</span> newNode = <span class="keyword">new</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 57</span> newNode-&gt;data = new_data;</div>
<div class="line"><span class="lineno"> 58</span> newNode-&gt;next = NULL;</div>
@@ -359,7 +358,7 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 60</span> head = newNode;</div>
<div class="line"><span class="lineno"> 61</span> head-&gt;next = head;</div>
<div class="line"><span class="lineno"> 62</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 63</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 63</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">while</span> (current-&gt;next != head) {</div>
<div class="line"><span class="lineno"> 65</span> current = current-&gt;next;</div>
<div class="line"><span class="lineno"> 66</span> }</div>
@@ -411,7 +410,7 @@ Protected Attributes</h2></td></tr>
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">if</span> (head == NULL) {</div>
<div class="line"><span class="lineno"> 100</span> cout &lt;&lt; <span class="stringliteral">&quot;List is empty !&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"> 101</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 102</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 102</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> *current = head;</div>
<div class="line"><span class="lineno"> 103</span> <span class="keywordflow">while</span> (current-&gt;next != head) {</div>
<div class="line"><span class="lineno"> 104</span> current = current-&gt;next;</div>
<div class="line"><span class="lineno"> 105</span> }</div>
@@ -439,7 +438,7 @@ Protected Attributes</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
<span class="mlabels"><span class="mlabel protected">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -463,7 +462,7 @@ Protected Attributes</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
<span class="mlabels"><span class="mlabel protected">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -482,7 +481,7 @@ Protected Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d15/classcll.html">cll</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: ListNode Pages: 1 -->
<svg width="103pt" height="27pt"

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 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: ListNode Pages: 1 -->
<svg width="103pt" height="27pt"

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.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++: bit_manipulation/next_higher_number_with_same_number_of_set_bits.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');
@@ -211,7 +211,7 @@ Functions</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -250,7 +250,7 @@ Functions</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html">next_higher_number_with_same_number_of_set_bits.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 next__higher__number__with__same__number__of__set__bits_8cpp =
[
[ "main", "d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "next_higher_number", "d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#a4b76571a2a04fa99c30a96eca9997f0e", null ],
[ "bit_manipulation::next_higher_number", "d7/d81/namespacebit__manipulation.html#a4b76571a2a04fa99c30a96eca9997f0e", null ],
[ "test", "d5/d1e/next__higher__number__with__same__number__of__set__bits_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++: bit_manipulation/next_higher_number_with_same_number_of_set_bits.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('d5/d1e/next__higher__number__with__same__number__of__s
<div class="headertitle"><div class="title">next_higher_number_with_same_number_of_set_bits.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_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="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include &lt;iostream&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="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a> {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span></div>
<div class="foldopen" id="foldopen00033" data-start="{" data-end="}">
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../d7/d81/namespacebit__manipulation.html#a4b76571a2a04fa99c30a96eca9997f0e"> 33</a></span>uint64_t <a class="code hl_function" href="../../d7/d81/namespacebit__manipulation.html#a4b76571a2a04fa99c30a96eca9997f0e">next_higher_number</a>(uint64_t x) {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> uint64_t rightOne = 0;</div>
@@ -169,7 +170,7 @@ $(function(){initNavTree('d5/d1e/next__higher__number__with__same__number__of__s
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>} <span class="comment">// namespace bit_manipulation</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span></div>
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 74</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// x = 4 return 8</span></div>
@@ -192,6 +193,7 @@ $(function(){initNavTree('d5/d1e/next__higher__number__with__same__number__of__s
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::cout &lt;&lt; <span class="stringliteral">&quot;All test cases have successfully passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>}</div>
</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span></div>
<div class="foldopen" id="foldopen00098" data-start="{" data-end="}">
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 98</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_function" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -208,7 +210,7 @@ $(function(){initNavTree('d5/d1e/next__higher__number__with__same__number__of__s
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d5/d1e/next__higher__number__with__same__number__of__set__bits_8cpp.html">next_higher_number_with_same_number_of_set_bits.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++: sorting/tim_sort.cpp Source File</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
@@ -60,7 +60,7 @@ window.MathJax = {
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -134,7 +134,7 @@ $(function(){initNavTree('d5/d1e/tim__sort_8cpp_source.html','../../'); initResi
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// this function sorts array from left index to to right index which is of size</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// atmost RUN</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a78cb2f3b97b6db2c062b2a1df05c9ea9">insertionSort</a>(<span class="keywordtype">int</span> arr[], <span class="keywordtype">int</span> left, <span class="keywordtype">int</span> right) {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keywordtype">void</span> insertionSort(<span class="keywordtype">int</span> arr[], <span class="keywordtype">int</span> left, <span class="keywordtype">int</span> right) {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = left + 1; i &lt;= right; i++) {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">const</span> <span class="keywordtype">int</span> temp = arr[i];</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">int</span> j = i - 1;</div>
@@ -147,7 +147,7 @@ $(function(){initNavTree('d5/d1e/tim__sort_8cpp_source.html','../../'); initResi
<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> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// merge function merges the sorted runs</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#aad643c14734394e784a75169cb58132f">merge</a>(<span class="keywordtype">int</span> arr[], <span class="keywordtype">int</span> l, <span class="keywordtype">int</span> m, <span class="keywordtype">int</span> r) {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a>(<span class="keywordtype">int</span> arr[], <span class="keywordtype">int</span> l, <span class="keywordtype">int</span> m, <span class="keywordtype">int</span> r) {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="comment">// original array is broken in two parts, left and right array</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">const</span> <span class="keywordtype">int</span> len1 = m - <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + 1, len2 = r - m;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">int</span> *left = <span class="keyword">new</span> <span class="keywordtype">int</span>[len1], *right = <span class="keyword">new</span> <span class="keywordtype">int</span>[len2];</div>
@@ -191,7 +191,7 @@ $(function(){initNavTree('d5/d1e/tim__sort_8cpp_source.html','../../'); initResi
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="keywordtype">void</span> timSort(<span class="keywordtype">int</span> arr[], <span class="keywordtype">int</span> n) {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// Sort individual subarrays of size RUN</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; i += RUN)</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a78cb2f3b97b6db2c062b2a1df05c9ea9">insertionSort</a>(arr, i, std::min((i + 31), (n - 1)));</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> insertionSort(arr, i, std::min((i + 31), (n - 1)));</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// start merging from size RUN (or 32). It will merge to form size 64, then</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// 128, 256 and so on ....</span></div>
@@ -206,7 +206,7 @@ $(function(){initNavTree('d5/d1e/tim__sort_8cpp_source.html','../../'); initResi
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keyword">const</span> <span class="keywordtype">int</span> right = std::min((left + 2 * size - 1), (n - 1));</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// merge sub array arr[left.....mid] &amp; arr[mid+1....right]</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_function" href="../../d2/d26/count__inversions_8cpp.html#aad643c14734394e784a75169cb58132f">merge</a>(arr, left, mid, right);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a>(arr, left, mid, right);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> }</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> }</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span>}</div>
@@ -216,11 +216,11 @@ $(function(){initNavTree('d5/d1e/tim__sort_8cpp_source.html','../../'); initResi
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; i++) printf(<span class="stringliteral">&quot;%d &quot;</span>, arr[i]);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span>}</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="keywordtype">void</span> <a class="code hl_namespace" href="../../d9/df4/namespacetests.html">tests</a>() {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// Case: array of length 65</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 65;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">int</span> arr[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>];</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> N = 65;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">int</span> arr[N];</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::iota(arr, arr + N, 0);</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::reverse(arr, arr + N);</div>
@@ -247,19 +247,17 @@ $(function(){initNavTree('d5/d1e/tim__sort_8cpp_source.html','../../'); initResi
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>}</div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(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#l00119">composite_simpson_rule.cpp:119</a></div></div>
<div class="ttc" id="acount__inversions_8cpp_html_aad643c14734394e784a75169cb58132f"><div class="ttname"><a href="../../d2/d26/count__inversions_8cpp.html#aad643c14734394e784a75169cb58132f">sorting::inversion::merge</a></div><div class="ttdeci">uint32_t merge(T *arr, T *temp, uint32_t left, uint32_t mid, uint32_t right)</div><div class="ttdoc">Function to merge two sub-arrays.</div><div class="ttdef"><b>Definition</b> <a href="../../d2/d26/count__inversions_8cpp_source.html#l00085">count_inversions.cpp:85</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="agroup__sorting_html_ga460c61cd948203b4816bef2accb3fc73"><div class="ttname"><a href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a></div><div class="ttdeci">void merge(int *arr, int l, int m, int r)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/df4/merge__sort_8cpp_source.html#l00033">merge_sort.cpp:33</a></div></div>
<div class="ttc" id="aheap__sort_8cpp_html_a9ed3e1510afdf3edd06cf2b68769a767"><div class="ttname"><a href="../../d2/d52/heap__sort_8cpp.html#a9ed3e1510afdf3edd06cf2b68769a767">printArray</a></div><div class="ttdeci">void printArray(T *arr, int sz)</div><div class="ttdef"><b>Definition</b> <a href="../../d2/d52/heap__sort_8cpp_source.html#l00037">heap_sort.cpp:37</a></div></div>
<div class="ttc" id="anamespacesorting_html_a78cb2f3b97b6db2c062b2a1df05c9ea9"><div class="ttname"><a href="../../d5/d91/namespacesorting.html#a78cb2f3b97b6db2c062b2a1df05c9ea9">sorting::insertionSort</a></div><div class="ttdeci">void insertionSort(T *arr, int n)</div><div class="ttdoc">Insertion Sort Function.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/d0d/insertion__sort_8cpp_source.html#l00059">insertion_sort.cpp:59</a></div></div>
<div class="ttc" id="anamespacetests_html"><div class="ttname"><a href="../../d9/df4/namespacetests.html">tests</a></div><div class="ttdoc">Testcases to check Union of Two Arrays.</div></div>
<div class="ttc" id="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><!-- 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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><b>tim_sort.cpp</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>

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/longest_increasing_subsequence_nlogn.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');
@@ -133,7 +133,7 @@ $(function(){initNavTree('d5/d21/longest__increasing__subsequence__nlogn_8cpp_so
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">using namespace </span>std;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dd/d24/namespacedynamic__programming.html#a0a2215194e58786c34db1ccaf8031079">LIS</a>(<span class="keyword">const</span> std::vector&lt;int&gt;&amp; arr, <span class="keywordtype">int</span> n) {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keywordtype">int</span> LIS(<span class="keyword">const</span> std::vector&lt;int&gt;&amp; arr, <span class="keywordtype">int</span> n) {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> set&lt;int&gt; active; <span class="comment">// The current built LIS.</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> active.insert(arr[0]);</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// Loop through every element.</span></div>
@@ -164,19 +164,18 @@ $(function(){initNavTree('d5/d21/longest__increasing__subsequence__nlogn_8cpp_so
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> cin &gt;&gt; a[i];</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> cout &lt;&lt; <a class="code hl_function" href="../../dd/d24/namespacedynamic__programming.html#a0a2215194e58786c34db1ccaf8031079">LIS</a>(a, n) &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> cout &lt;&lt; LIS(a, n) &lt;&lt; <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>}</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="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>
<div class="ttc" id="anamespacedynamic__programming_html_a0a2215194e58786c34db1ccaf8031079"><div class="ttname"><a href="../../dd/d24/namespacedynamic__programming.html#a0a2215194e58786c34db1ccaf8031079">dynamic_programming::LIS</a></div><div class="ttdeci">uint64_t LIS(const std::vector&lt; uint64_t &gt; &amp;a, const uint32_t &amp;n)</div><div class="ttdoc">Calculate the longest increasing subsequence for the specified numbers.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d57/longest__increasing__subsequence_8cpp_source.html#l00040">longest_increasing_subsequence.cpp:40</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_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><b>longest_increasing_subsequence_nlogn.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++: sorting/bead_sort.cpp Source File</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
@@ -60,7 +60,7 @@ window.MathJax = {
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -188,7 +188,7 @@ $(function(){initNavTree('d5/d25/bead__sort_8cpp_source.html','../../'); initRes
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><b>bead_sort.cpp</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>

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; uint128_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; uint128_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="../../d5/d25/structstd_1_1is__unsigned_3_01uint128__t_01_4.html">is_unsigned&lt; uint128_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++: MinHeapNode 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');
@@ -176,7 +176,7 @@ Public 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">
@@ -264,7 +264,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d29/struct_min_heap_node.html">MinHeapNode</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++: layers 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('d5/d2c/namespacelayers.html','../../'); initResizable(
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d2c/namespacelayers.html">layers</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/gram_schmidt.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');
@@ -262,13 +262,12 @@ Algorithm</h3>
<p class="definition">Definition at line <a class="el" href="../../d5/d33/gram__schmidt_8cpp_source.html#l00059">59</a> of file <a class="el" href="../../d5/d33/gram__schmidt_8cpp_source.html">gram_schmidt.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 60</span> {</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> = 0;</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordtype">double</span> sum = 0;</div>
<div class="line"><span class="lineno"> 62</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; c; ++i) {</div>
<div class="line"><span class="lineno"> 63</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a> += x[i] * y[i];</div>
<div class="line"><span class="lineno"> 63</span> sum += x[i] * y[i];</div>
<div class="line"><span class="lineno"> 64</span> }</div>
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>;</div>
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">return</span> sum;</div>
<div class="line"><span class="lineno"> 66</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>
@@ -329,7 +328,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 128</span> r = c;</div>
<div class="line"><span class="lineno"> 129</span> }</div>
<div class="line"><span class="lineno"> 130</span> </div>
<div class="line"><span class="lineno"> 131</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = 1;</div>
<div class="line"><span class="lineno"> 131</span> <span class="keywordtype">int</span> k = 1;</div>
<div class="line"><span class="lineno"> 132</span> </div>
<div class="line"><span class="lineno"> 133</span> <span class="keywordflow">while</span> (k &lt;= r) {</div>
<div class="line"><span class="lineno"> 134</span> <span class="keywordflow">if</span> (k == 1) {</div>
@@ -368,11 +367,12 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 170</span> }</div>
<div class="line"><span class="lineno"> 171</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++;</div>
<div class="line"><span class="lineno"> 172</span> }</div>
<div class="line"><span class="lineno"> 173</span> display(r, c, B); <span class="comment">// for displaying orthogoanlised vectors</span></div>
<div class="line"><span class="lineno"> 173</span> <a class="code hl_function" href="#ae6b496dce691e04f7f95ba0f0d33a289">display</a>(r, c, B); <span class="comment">// for displaying orthogoanlised vectors</span></div>
<div class="line"><span class="lineno"> 174</span>}</div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(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#l00119">composite_simpson_rule.cpp:119</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_a8eeaafdde8b56f459aadc6013cf078bc"><div class="ttname"><a href="#a8eeaafdde8b56f459aadc6013cf078bc">numerical_methods::gram_schmidt::projection</a></div><div class="ttdeci">double projection(const std::array&lt; double, 10 &gt; &amp;x, const std::array&lt; double, 10 &gt; &amp;y, const int &amp;c)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d33/gram__schmidt_8cpp_source.html#l00079">gram_schmidt.cpp:79</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_ae6b496dce691e04f7f95ba0f0d33a289"><div class="ttname"><a href="#ae6b496dce691e04f7f95ba0f0d33a289">numerical_methods::gram_schmidt::display</a></div><div class="ttdeci">void display(const int &amp;r, const int &amp;c, const std::array&lt; std::array&lt; double, 10 &gt;, 20 &gt; &amp;B)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d33/gram__schmidt_8cpp_source.html#l00101">gram_schmidt.cpp:101</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -430,7 +430,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 275</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; r - 1; ++i) {</div>
<div class="line"><span class="lineno"> 276</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; r; ++j) {</div>
<div class="line"><span class="lineno"> 277</span> dot = fabs(</div>
<div class="line"><span class="lineno"> 278</span> numerical_methods::gram_schmidt::dot_product(B[i], B[j], c));</div>
<div class="line"><span class="lineno"> 278</span> <a class="code hl_function" href="#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(B[i], B[j], c));</div>
<div class="line"><span class="lineno"> 279</span> <span class="keywordflow">if</span> (dot &gt; 0.1) </div>
<div class="line"><span class="lineno"> 281</span> {</div>
<div class="line"><span class="lineno"> 282</span> flag = 0;</div>
@@ -444,6 +444,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 290</span>}</div>
<div class="ttc" id="agram__schmidt_8cpp_html_a0837468e1a653ed056e2cce3c914afa5"><div class="ttname"><a href="#a0837468e1a653ed056e2cce3c914afa5">numerical_methods::gram_schmidt::gram_schmidt</a></div><div class="ttdeci">void gram_schmidt(int r, const int &amp;c, const std::array&lt; std::array&lt; double, 10 &gt;, 20 &gt; &amp;A, std::array&lt; std::array&lt; double, 10 &gt;, 20 &gt; B)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d33/gram__schmidt_8cpp_source.html#l00121">gram_schmidt.cpp:121</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d33/gram__schmidt_8cpp_source.html#l00181">gram_schmidt.cpp:181</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_ac4a4504924ecc9f12a2ebd80788ec01d"><div class="ttname"><a href="#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a></div><div class="ttdeci">double dot_product(const std::array&lt; double, 10 &gt; &amp;x, const std::array&lt; double, 10 &gt; &amp;y, const int &amp;c)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d33/gram__schmidt_8cpp_source.html#l00059">gram_schmidt.cpp:59</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -495,7 +496,6 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 87</span> anorm; </div>
<div class="line"><span class="lineno"> 89</span> <span class="keywordflow">return</span> factor;</div>
<div class="line"><span class="lineno"> 90</span>}</div>
<div class="ttc" id="agram__schmidt_8cpp_html_ac4a4504924ecc9f12a2ebd80788ec01d"><div class="ttname"><a href="#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a></div><div class="ttdeci">double dot_product(const std::array&lt; double, 10 &gt; &amp;x, const std::array&lt; double, 10 &gt; &amp;y, const int &amp;c)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d33/gram__schmidt_8cpp_source.html#l00059">gram_schmidt.cpp:59</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -517,7 +517,7 @@ Algorithm</h3>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -534,7 +534,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 188</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 2; ++i) {</div>
<div class="line"><span class="lineno"> 189</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; 3; ++j) {</div>
<div class="line"><span class="lineno"> 190</span> dot1 = fabs(</div>
<div class="line"><span class="lineno"> 191</span> numerical_methods::gram_schmidt::dot_product(b1[i], b1[j], 4));</div>
<div class="line"><span class="lineno"> 191</span> <a class="code hl_function" href="#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(b1[i], b1[j], 4));</div>
<div class="line"><span class="lineno"> 192</span> <span class="keywordflow">if</span> (dot1 &gt; 0.1) {</div>
<div class="line"><span class="lineno"> 193</span> flag = 0;</div>
<div class="line"><span class="lineno"> 194</span> <span class="keywordflow">break</span>;</div>
@@ -554,7 +554,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 208</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 1; ++i) {</div>
<div class="line"><span class="lineno"> 209</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; 2; ++j) {</div>
<div class="line"><span class="lineno"> 210</span> dot2 = fabs(</div>
<div class="line"><span class="lineno"> 211</span> numerical_methods::gram_schmidt::dot_product(b2[i], b2[j], 2));</div>
<div class="line"><span class="lineno"> 211</span> <a class="code hl_function" href="#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(b2[i], b2[j], 2));</div>
<div class="line"><span class="lineno"> 212</span> <span class="keywordflow">if</span> (dot2 &gt; 0.1) {</div>
<div class="line"><span class="lineno"> 213</span> flag = 0;</div>
<div class="line"><span class="lineno"> 214</span> <span class="keywordflow">break</span>;</div>
@@ -574,7 +574,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 228</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 1; ++i) {</div>
<div class="line"><span class="lineno"> 229</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; 2; ++j) {</div>
<div class="line"><span class="lineno"> 230</span> dot3 = fabs(</div>
<div class="line"><span class="lineno"> 231</span> numerical_methods::gram_schmidt::dot_product(b3[i], b3[j], 3));</div>
<div class="line"><span class="lineno"> 231</span> <a class="code hl_function" href="#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(b3[i], b3[j], 3));</div>
<div class="line"><span class="lineno"> 232</span> <span class="keywordflow">if</span> (dot3 &gt; 0.1) {</div>
<div class="line"><span class="lineno"> 233</span> flag = 0;</div>
<div class="line"><span class="lineno"> 234</span> <span class="keywordflow">break</span>;</div>
@@ -595,7 +595,7 @@ Algorithm</h3>
<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="../../d5/d33/gram__schmidt_8cpp.html">gram_schmidt.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,9 +1,9 @@
var gram__schmidt_8cpp =
[
[ "display", "d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289", null ],
[ "dot_product", "d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d", null ],
[ "gram_schmidt", "d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5", null ],
[ "numerical_methods::gram_schmidt::display", "d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289", null ],
[ "numerical_methods::gram_schmidt::dot_product", "d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d", null ],
[ "numerical_methods::gram_schmidt::gram_schmidt", "d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5", null ],
[ "main", "d5/d33/gram__schmidt_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "projection", "d5/d33/gram__schmidt_8cpp.html#a8eeaafdde8b56f459aadc6013cf078bc", null ],
[ "numerical_methods::gram_schmidt::projection", "d5/d33/gram__schmidt_8cpp.html#a8eeaafdde8b56f459aadc6013cf078bc", null ],
[ "test", "d5/d33/gram__schmidt_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++: numerical_methods/gram_schmidt.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,15 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="headertitle"><div class="title">gram_schmidt.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d33/gram__schmidt_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="../../d5/d33/gram__schmidt_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="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include &lt;array&gt;</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include &lt;cmath&gt;</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include &quot;math.h&quot;</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</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="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/d0f/namespacegram__schmidt.html">gram_schmidt</a> {</div>
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
@@ -144,7 +145,7 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> sum;</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="foldopen00079" data-start="{" data-end="}">
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="../../d5/d33/gram__schmidt_8cpp.html#a8eeaafdde8b56f459aadc6013cf078bc"> 79</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#a8eeaafdde8b56f459aadc6013cf078bc">projection</a>(<span class="keyword">const</span> std::array&lt;double, 10&gt;&amp; x,</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keyword">const</span> std::array&lt;double, 10&gt;&amp; y, <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; c) {</div>
@@ -158,9 +159,9 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">return</span> factor;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>}</div>
</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</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="../../d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289"> 101</a></span><span class="keywordtype">void</span> display(<span class="keyword">const</span> <span class="keywordtype">int</span>&amp; r, <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; c,</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="../../d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289"> 101</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289">display</a>(<span class="keyword">const</span> <span class="keywordtype">int</span>&amp; r, <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; c,</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">const</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt;&amp; B) {</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; r; ++i) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Vector &quot;</span> &lt;&lt; i + 1 &lt;&lt; <span class="stringliteral">&quot;: &quot;</span>;</div>
@@ -171,7 +172,7 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>}</div>
</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span></div>
<div class="foldopen" id="foldopen00121" data-start="{" data-end="}">
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="../../d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5"> 121</a></span><span class="keywordtype">void</span> <a class="code hl_namespace" href="../../d4/d0f/namespacegram__schmidt.html">gram_schmidt</a>(<span class="keywordtype">int</span> r, <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; c,</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keyword">const</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt;&amp; A,</div>
@@ -222,7 +223,7 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> }</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> k++;</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> }</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> display(r, c, B); <span class="comment">// for displaying orthogoanlised vectors</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289">display</a>(r, c, B); <span class="comment">// for displaying orthogoanlised vectors</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span>}</div>
</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span>} <span class="comment">// namespace gram_schmidt</span></div>
@@ -233,12 +234,12 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> {{1, 0, 1, 0}, {1, 1, 1, 1}, {0, 1, 2, 1}}};</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt; b1 = {{0}};</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keywordtype">double</span> dot1 = 0;</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> numerical_methods::gram_schmidt::gram_schmidt(3, 4, a1, b1);</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5">numerical_methods::gram_schmidt::gram_schmidt</a>(3, 4, a1, b1);</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordtype">int</span> flag = 1;</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 2; ++i) {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; 3; ++j) {</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> dot1 = fabs(</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> numerical_methods::gram_schmidt::dot_product(b1[i], b1[j], 4));</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(b1[i], b1[j], 4));</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="keywordflow">if</span> (dot1 &gt; 0.1) {</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> flag = 0;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">break</span>;</div>
@@ -253,12 +254,12 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt; a2 = {{{3, 1}, {2, 2}}};</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt; b2 = {{0}};</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keywordtype">double</span> dot2 = 0;</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> numerical_methods::gram_schmidt::gram_schmidt(2, 2, a2, b2);</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5">numerical_methods::gram_schmidt::gram_schmidt</a>(2, 2, a2, b2);</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> flag = 1;</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 1; ++i) {</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; 2; ++j) {</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> dot2 = fabs(</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> numerical_methods::gram_schmidt::dot_product(b2[i], b2[j], 2));</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(b2[i], b2[j], 2));</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordflow">if</span> (dot2 &gt; 0.1) {</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> flag = 0;</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keywordflow">break</span>;</div>
@@ -273,12 +274,12 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt; a3 = {{{1, 2, 2}, {-4, 3, 2}}};</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> std::array&lt;std::array&lt;double, 10&gt;, 20&gt; b3 = {{0}};</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="keywordtype">double</span> dot3 = 0;</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> numerical_methods::gram_schmidt::gram_schmidt(2, 3, a3, b3);</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5">numerical_methods::gram_schmidt::gram_schmidt</a>(2, 3, a3, b3);</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> flag = 1;</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 1; ++i) {</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; 2; ++j) {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> dot3 = fabs(</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> numerical_methods::gram_schmidt::dot_product(b3[i], b3[j], 3));</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(b3[i], b3[j], 3));</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keywordflow">if</span> (dot3 &gt; 0.1) {</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> flag = 0;</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordflow">break</span>;</div>
@@ -291,7 +292,7 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Passed Test Case 3\n&quot;</span>;</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span>}</div>
</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span></div>
<div class="foldopen" id="foldopen00248" data-start="{" data-end="}">
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="../../d5/d33/gram__schmidt_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 248</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keywordtype">int</span> r = 0, c = 0;</div>
@@ -315,14 +316,14 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> std::cout &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> }</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> </div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> numerical_methods::gram_schmidt::gram_schmidt(r, c, A, B);</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5">numerical_methods::gram_schmidt::gram_schmidt</a>(r, c, A, B);</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> </div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keywordtype">double</span> dot = 0;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordtype">int</span> flag = 1; </div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; r - 1; ++i) {</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i + 1; j &lt; r; ++j) {</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> dot = fabs(</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> numerical_methods::gram_schmidt::dot_product(B[i], B[j], c));</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <a class="code hl_function" href="../../d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a>(B[i], B[j], c));</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keywordflow">if</span> (dot &gt; 0.1) </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> {</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> flag = 0;</div>
@@ -335,10 +336,12 @@ $(function(){initNavTree('d5/d33/gram__schmidt_8cpp_source.html','../../'); init
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span>}</div>
</div>
<div class="ttc" id="agram__schmidt_8cpp_html_a0837468e1a653ed056e2cce3c914afa5"><div class="ttname"><a href="../../d5/d33/gram__schmidt_8cpp.html#a0837468e1a653ed056e2cce3c914afa5">numerical_methods::gram_schmidt::gram_schmidt</a></div><div class="ttdeci">void gram_schmidt(int r, const int &amp;c, const std::array&lt; std::array&lt; double, 10 &gt;, 20 &gt; &amp;A, std::array&lt; std::array&lt; double, 10 &gt;, 20 &gt; B)</div><div class="ttdef"><b>Definition</b> <a href="#l00121">gram_schmidt.cpp:121</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_a8eeaafdde8b56f459aadc6013cf078bc"><div class="ttname"><a href="../../d5/d33/gram__schmidt_8cpp.html#a8eeaafdde8b56f459aadc6013cf078bc">numerical_methods::gram_schmidt::projection</a></div><div class="ttdeci">double projection(const std::array&lt; double, 10 &gt; &amp;x, const std::array&lt; double, 10 &gt; &amp;y, const int &amp;c)</div><div class="ttdef"><b>Definition</b> <a href="#l00079">gram_schmidt.cpp:79</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d5/d33/gram__schmidt_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition</b> <a href="#l00181">gram_schmidt.cpp:181</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_ac4a4504924ecc9f12a2ebd80788ec01d"><div class="ttname"><a href="../../d5/d33/gram__schmidt_8cpp.html#ac4a4504924ecc9f12a2ebd80788ec01d">numerical_methods::gram_schmidt::dot_product</a></div><div class="ttdeci">double dot_product(const std::array&lt; double, 10 &gt; &amp;x, const std::array&lt; double, 10 &gt; &amp;y, const int &amp;c)</div><div class="ttdef"><b>Definition</b> <a href="#l00059">gram_schmidt.cpp:59</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d5/d33/gram__schmidt_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="#l00248">gram_schmidt.cpp:248</a></div></div>
<div class="ttc" id="agram__schmidt_8cpp_html_ae6b496dce691e04f7f95ba0f0d33a289"><div class="ttname"><a href="../../d5/d33/gram__schmidt_8cpp.html#ae6b496dce691e04f7f95ba0f0d33a289">numerical_methods::gram_schmidt::display</a></div><div class="ttdeci">void display(const int &amp;r, const int &amp;c, const std::array&lt; std::array&lt; double, 10 &gt;, 20 &gt; &amp;B)</div><div class="ttdef"><b>Definition</b> <a href="#l00101">gram_schmidt.cpp:101</a></div></div>
<div class="ttc" id="anamespacegram__schmidt_html"><div class="ttname"><a href="../../d4/d0f/namespacegram__schmidt.html">gram_schmidt</a></div><div class="ttdoc">Functions for Gram Schmidt Orthogonalisation Process</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 -->
@@ -347,7 +350,7 @@ $(function(){initNavTree('d5/d33/gram__schmidt_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_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d5/d33/gram__schmidt_8cpp.html">gram_schmidt.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++: activations 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('d5/d39/namespaceactivations.html','../../'); initResiz
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d39/namespaceactivations.html">activations</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 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');
@@ -234,7 +234,7 @@ Variables</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -346,7 +346,7 @@ Variables</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -389,7 +389,7 @@ Variables</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
<span class="mlabels"><span class="mlabel constexpr">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -415,7 +415,7 @@ Variables</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
<span class="mlabels"><span class="mlabel constexpr">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -432,7 +432,7 @@ Variables</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</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: sorting/selection_sort_recursive.cpp Pages: 1 -->
<svg width="325pt" height="94pt"

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.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: sorting/selection_sort_recursive.cpp Pages: 1 -->
<svg width="325pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 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/sublist_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');
@@ -329,26 +329,25 @@ Working</h3>
<p class="definition">Definition at line <a class="el" href="../../d5/d45/sublist__search_8cpp_source.html#l00074">74</a> of file <a class="el" href="../../d5/d45/sublist__search_8cpp_source.html">sublist_search.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 74</span> {</div>
<div class="line"><span class="lineno"> 77</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *head = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *tail = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 77</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *head = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *tail = <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i : <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
<div class="line"><span class="lineno"> 80</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>;</div>
<div class="line"><span class="lineno"> 80</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a>;</div>
<div class="line"><span class="lineno"> 81</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;data = i;</div>
<div class="line"><span class="lineno"> 82</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"> 83</span> <span class="keywordflow">if</span> (head == <span class="keyword">nullptr</span>) {</div>
<div class="line"><span class="lineno"> 84</span> head = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 85</span> tail = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 84</span> head = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
<div class="line"><span class="lineno"> 85</span> tail = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
<div class="line"><span class="lineno"> 86</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 87</span> tail-&gt;next = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><span class="lineno"> 88</span> tail = tail-&gt;next;</div>
<div class="line"><span class="lineno"> 87</span> tail-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a> = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
<div class="line"><span class="lineno"> 88</span> tail = tail-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a>;</div>
<div class="line"><span class="lineno"> 89</span> }</div>
<div class="line"><span class="lineno"> 90</span> }</div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">return</span> head;</div>
<div class="line"><span class="lineno"> 92</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 class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</a></div></div>
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/dce/linkedlist__implentation__usingarray_8cpp_source.html#l00014">linkedlist_implentation_usingarray.cpp:14</a></div></div>
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/d26/binary__search__tree_8cpp_source.html#l00011">binary_search_tree.cpp:11</a></div></div>
<div class="ttc" id="astructsearch_1_1sublist__search_1_1_node_html_afe96e03dd6a404480ab43d1e88363a7a"><div class="ttname"><a href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">search::sublist_search::Node::next</a></div><div class="ttdeci">Node * next</div><div class="ttdoc">pointer to the next node</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d45/sublist__search_8cpp_source.html#l00050">sublist_search.cpp:50</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -430,7 +429,7 @@ false if the sublist is NOT found </dd></dl>
<div class="line"><span class="lineno"> 116</span> <span class="keywordflow">if</span> (sublist == <span class="keyword">nullptr</span> || mainList == <span class="keyword">nullptr</span>) {</div>
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 118</span> }</div>
<div class="line"><span class="lineno"> 119</span> </div>
<div class="line"><span class="lineno"> 119</span></div>
<div class="line"><span class="lineno"> 121</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *target_ptr = sublist;</div>
<div class="line"><span class="lineno"> 122</span> </div>
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">while</span> (mainList != <span class="keyword">nullptr</span>) {</div>
@@ -452,14 +451,15 @@ false if the sublist is NOT found </dd></dl>
<div class="line"><span class="lineno"> 142</span> <span class="keywordflow">if</span> (target_ptr == <span class="keyword">nullptr</span>) {</div>
<div class="line"><span class="lineno"> 146</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 147</span> }</div>
<div class="line"><span class="lineno"> 148</span> </div>
<div class="line"><span class="lineno"> 148</span></div>
<div class="line"><span class="lineno"> 150</span> target_ptr = sublist;</div>
<div class="line"><span class="lineno"> 151</span> </div>
<div class="line"><span class="lineno"> 154</span> mainList = mainList-&gt;next;</div>
<div class="line"><span class="lineno"> 151</span></div>
<div class="line"><span class="lineno"> 154</span> mainList = mainList-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a>;</div>
<div class="line"><span class="lineno"> 155</span> }</div>
<div class="line"><span class="lineno"> 156</span> </div>
<div class="line"><span class="lineno"> 156</span></div>
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 160</span>}</div>
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition</b> <a href="../../d3/dce/linkedlist__implentation__usingarray_8cpp_source.html#l00014">linkedlist_implentation_usingarray.cpp:14</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -481,7 +481,7 @@ false if the sublist is NOT found </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">
@@ -505,7 +505,7 @@ false if the sublist is NOT found </dd></dl>
<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="../../d5/d45/sublist__search_8cpp.html">sublist_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

@@ -3,8 +3,8 @@ var sublist__search_8cpp =
[ "search::sublist_search::Node", "da/d61/structsearch_1_1sublist__search_1_1_node.html", "da/d61/structsearch_1_1sublist__search_1_1_node" ],
[ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ],
[ "main", "d5/d45/sublist__search_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
[ "makeLinkedList", "d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53", null ],
[ "printLinkedList", "d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2", null ],
[ "sublistSearch", "d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c", null ],
[ "search::sublist_search::makeLinkedList", "d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53", null ],
[ "search::sublist_search::printLinkedList", "d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2", null ],
[ "search::sublist_search::sublistSearch", "d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c", null ],
[ "test", "d5/d45/sublist__search_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++: search/sublist_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,12 +124,13 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="headertitle"><div class="title">sublist_search.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d45/sublist__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="../../d5/d45/sublist__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="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include &lt;vector&gt;</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/dca/namespacesearch.html">search</a> {</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/def/namespacesublist__search.html">sublist_search</a> {</div>
<div class="foldopen" id="foldopen00048" data-start="{" data-end="};">
@@ -138,7 +139,7 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a"> 50</a></span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a>{}; </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>};</div>
</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2"> 58</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2">printLinkedList</a>(<a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *start) {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">while</span> (start != <span class="keyword">nullptr</span>) {</div>
@@ -148,7 +149,7 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>}</div>
</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="foldopen" id="foldopen00074" data-start="{" data-end="}">
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53"> 74</a></span><a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *<a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">makeLinkedList</a>(<span class="keyword">const</span> std::vector&lt;uint64_t&gt; &amp;<a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *head = <span class="keyword">nullptr</span>;</div>
@@ -158,10 +159,10 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;data = i;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>-&gt;next = <span class="keyword">nullptr</span>;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">if</span> (head == <span class="keyword">nullptr</span>) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> head = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> tail = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> head = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> tail = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> tail-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a> = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> tail-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a> = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> tail = tail-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
@@ -182,13 +183,13 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keyword">delete</span> root;</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="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c"> 115</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c">sublistSearch</a>(<a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *sublist, <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *mainList) {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">if</span> (sublist == <span class="keyword">nullptr</span> || mainList == <span class="keyword">nullptr</span>) {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">Node</a> *target_ptr = sublist;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">while</span> (mainList != <span class="keyword">nullptr</span>) {</div>
@@ -210,19 +211,19 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">if</span> (target_ptr == <span class="keyword">nullptr</span>) {</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> target_ptr = sublist;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> mainList = mainList-&gt;<a class="code hl_variable" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html#afe96e03dd6a404480ab43d1e88363a7a">next</a>;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span>}</div>
</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span>} <span class="comment">// namespace sublist_search</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span>} <span class="comment">// namespace search</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="keyword">class </span><a class="code hl_class" href="../../d5/d58/class_test_cases.html">TestCases</a> {</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
@@ -246,7 +247,7 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> }</div>
</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span></div>
<div class="foldopen" id="foldopen00201" data-start="{" data-end="}">
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008"> 201</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008">testCase_1</a>() {</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> expectedOutput = <span class="keyword">true</span>; </div>
@@ -264,13 +265,13 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> 8}; </div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> sublistData); </div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> mainlistData); </div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordtype">bool</span> exists = search::sublist_search::sublistSearch(</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordtype">bool</span> exists = <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c">search::sublist_search::sublistSearch</a>(</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> sublistLL, mainlistLL); </div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> </div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;Checking assert expression...&quot;</span>);</div>
@@ -285,7 +286,7 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> deleteList(sublistLL);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> }</div>
</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> </div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span></div>
<div class="foldopen" id="foldopen00244" data-start="{" data-end="}">
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3"> 244</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3">testCase_2</a>() {</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> expectedOutput = <span class="keyword">true</span>; </div>
@@ -312,13 +313,13 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> }</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> </div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> sublistData); </div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> mainlistData); </div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> </div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="keywordtype">bool</span> exists = search::sublist_search::sublistSearch(</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="keywordtype">bool</span> exists = <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c">search::sublist_search::sublistSearch</a>(</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> sublistLL, mainlistLL); </div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> </div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;Checking assert expression...&quot;</span>);</div>
@@ -333,7 +334,7 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> deleteList(sublistLL);</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> }</div>
</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> </div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span></div>
<div class="foldopen" id="foldopen00298" data-start="{" data-end="}">
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"><a class="line" href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5"> 298</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5">testCase_3</a>() {</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> expectedOutput = <span class="keyword">false</span>; </div>
@@ -357,13 +358,13 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> }</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> </div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> sublistData); </div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> mainlistData); </div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> </div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> <span class="keywordtype">bool</span> exists = search::sublist_search::sublistSearch(</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> <span class="keywordtype">bool</span> exists = <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c">search::sublist_search::sublistSearch</a>(</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> sublistLL, mainlistLL); </div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> </div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> <a class="code hl_function" href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;Checking assert expression...&quot;</span>);</div>
@@ -379,14 +380,14 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> }</div>
</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span>};</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> </div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span></div>
<div class="foldopen" id="foldopen00349" data-start="{" data-end="}">
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"><a class="line" href="../../d5/d45/sublist__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 349</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> <a class="code hl_class" href="../../d5/d58/class_test_cases.html">TestCases</a> tc;</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> tc.<a class="code hl_function" href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23">runTests</a>();</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span>}</div>
</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> </div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span></div>
<div class="foldopen" id="foldopen00360" data-start="{" data-end="}">
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"><a class="line" href="../../d5/d45/sublist__search_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 360</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="l00361" name="l00361"></a><span class="lineno"> 361</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -396,20 +397,20 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> std::vector&lt;uint64_t&gt; sublistData = {6, 8}; </div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> </div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span> search::sublist_search::makeLinkedList(mainlistData);</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(mainlistData);</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> search::sublist_search::makeLinkedList(</div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> sublistData); </div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> </div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> <span class="keywordtype">bool</span> exists = search::sublist_search::sublistSearch(</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> <span class="keywordtype">bool</span> exists = <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c">search::sublist_search::sublistSearch</a>(</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> sublistLL,</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> mainlistLL); </div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> </div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Sublist: &quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> search::sublist_search::printLinkedList(sublistLL);</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2">search::sublist_search::printLinkedList</a>(sublistLL);</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> </div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Main list: &quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> search::sublist_search::printLinkedList(mainlistLL);</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#ad1028bc215281d62e344af99da57fab2">search::sublist_search::printLinkedList</a>(mainlistLL);</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"> 383</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span> </div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> <span class="keywordflow">if</span> (exists) {</div>
@@ -423,7 +424,6 @@ $(function(){initNavTree('d5/d45/sublist__search_8cpp_source.html','../../'); in
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</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="aclass_test_cases_html"><div class="ttname"><a href="../../d5/d58/class_test_cases.html">TestCases</a></div><div class="ttdoc">class encapsulating the necessary test cases</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00225">inorder_successor_of_bst.cpp:225</a></div></div>
<div class="ttc" id="aclass_test_cases_html_aa3aa3d5bf666f327ee8e2d11d397b06e"><div class="ttname"><a href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e">TestCases::log</a></div><div class="ttdeci">void log(T msg)</div><div class="ttdoc">A function to print given message on console.</div><div class="ttdef"><b>Definition</b> <a href="#l00176">sublist_search.cpp:176</a></div></div>
<div class="ttc" id="aclass_test_cases_html_abae0148985f159b582a385cf399254e3"><div class="ttname"><a href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3">TestCases::testCase_2</a></div><div class="ttdeci">void testCase_2()</div><div class="ttdoc">A test case which contains main list of 100 elements and sublist of 20.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00304">inorder_successor_of_bst.cpp:304</a></div></div>
@@ -449,7 +449,7 @@ $(function(){initNavTree('d5/d45/sublist__search_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_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><a class="el" href="../../d5/d45/sublist__search_8cpp.html">sublist_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++: 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('d3/d26/classdata__structures_1_1trie__using__hashmap_1
<!-- 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: dynamic_programming/shortest_common_supersequence.cpp Pages: 1 -->
<svg width="321pt" height="94pt"

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.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: dynamic_programming/shortest_common_supersequence.cpp Pages: 1 -->
<svg width="321pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.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++: Sorting Algorithm</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,10 +146,10 @@ Namespaces</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gabd9a93f241c5c86f2ec0abf8b66b4145" id="r_gabd9a93f241c5c86f2ec0abf8b66b4145"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:gabd9a93f241c5c86f2ec0abf8b66b4145" id="r_gabd9a93f241c5c86f2ec0abf8b66b4145"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:gabd9a93f241c5c86f2ec0abf8b66b4145"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#gabd9a93f241c5c86f2ec0abf8b66b4145">heapify</a> (T *arr, int n, int i)</td></tr>
<tr class="separator:gabd9a93f241c5c86f2ec0abf8b66b4145"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29d28b140174dbdde7c9f5157758435f" id="r_ga29d28b140174dbdde7c9f5157758435f"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ga29d28b140174dbdde7c9f5157758435f" id="r_ga29d28b140174dbdde7c9f5157758435f"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:ga29d28b140174dbdde7c9f5157758435f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ga29d28b140174dbdde7c9f5157758435f">heapSort</a> (T *arr, int n)</td></tr>
<tr class="separator:ga29d28b140174dbdde7c9f5157758435f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga460c61cd948203b4816bef2accb3fc73" id="r_ga460c61cd948203b4816bef2accb3fc73"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga460c61cd948203b4816bef2accb3fc73">merge</a> (int *arr, int l, int m, int r)</td></tr>
@@ -160,7 +160,7 @@ Functions</h2></td></tr>
<tr class="separator:ga0a9a57a1f1bbba3d4822531d002b7e07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae66f6b31b5ad750f1fe042a706a4e3d4" id="r_gae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="separator:gae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga135e4c638e3bcf548bd122b5f49a3e72" id="r_ga135e4c638e3bcf548bd122b5f49a3e72"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ga135e4c638e3bcf548bd122b5f49a3e72" id="r_ga135e4c638e3bcf548bd122b5f49a3e72"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:ga135e4c638e3bcf548bd122b5f49a3e72"><td class="memTemplItemLeft" align="right" valign="top">static void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ga135e4c638e3bcf548bd122b5f49a3e72">displayElements</a> (const std::vector&lt; T &gt; &amp;arr)</td></tr>
<tr class="memdesc:ga135e4c638e3bcf548bd122b5f49a3e72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function used for printing the elements. Prints elements of the array after they're sorted using wiggle sort algorithm. <br /></td></tr>
<tr class="separator:ga135e4c638e3bcf548bd122b5f49a3e72"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -184,7 +184,7 @@ Functions</h2></td></tr>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -198,7 +198,7 @@ template&lt;typename T &gt; </div>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -239,7 +239,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void heapify </td>
@@ -262,11 +262,11 @@ template&lt;typename T &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d2/d52/heap__sort_8cpp_source.html#l00058">58</a> of file <a class="el" href="../../d2/d52/heap__sort_8cpp_source.html">heap_sort.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 58</span> {</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordtype">int</span> largest = i;</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">int</span> l = 2 * i + 1;</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> = 2 * i + 1;</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordtype">int</span> r = 2 * i + 2;</div>
<div class="line"><span class="lineno"> 62</span> </div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">if</span> (l &lt; n &amp;&amp; arr[l] &gt; arr[largest])</div>
<div class="line"><span class="lineno"> 64</span> largest = l;</div>
<div class="line"><span class="lineno"> 64</span> largest = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>;</div>
<div class="line"><span class="lineno"> 65</span> </div>
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">if</span> (r &lt; n &amp;&amp; arr[r] &gt; arr[largest])</div>
<div class="line"><span class="lineno"> 67</span> largest = r;</div>
@@ -276,6 +276,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 71</span> heapify(arr, n, largest);</div>
<div class="line"><span class="lineno"> 72</span> }</div>
<div class="line"><span class="lineno"> 73</span>}</div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a6d8df83a6f26ce24a75d3b358b7f5b8a"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">numerical_methods::simpson_method::l</a></div><div class="ttdeci">double l(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#l00119">composite_simpson_rule.cpp:119</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -285,7 +286,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void heapSort </td>
@@ -404,8 +405,8 @@ template&lt;typename T &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d5/df4/merge__sort_8cpp_source.html#l00033">33</a> of file <a class="el" href="../../d5/df4/merge__sort_8cpp_source.html">merge_sort.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 33</span> {</div>
<div class="line"><span class="lineno"> 34</span> <span class="keywordtype">int</span> i, j, k;</div>
<div class="line"><span class="lineno"> 35</span> <span class="keywordtype">int</span> n1 = m - l + 1;</div>
<div class="line"><span class="lineno"> 34</span> <span class="keywordtype">int</span> i, j, <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>;</div>
<div class="line"><span class="lineno"> 35</span> <span class="keywordtype">int</span> n1 = m - <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + 1;</div>
<div class="line"><span class="lineno"> 36</span> <span class="keywordtype">int</span> n2 = r - m;</div>
<div class="line"><span class="lineno"> 37</span> </div>
<div class="line"><span class="lineno"> 38</span> <span class="keywordtype">int</span> *L = <span class="keyword">new</span> <span class="keywordtype">int</span>[n1], *R = <span class="keyword">new</span> <span class="keywordtype">int</span>[n2];</div>
@@ -415,13 +416,13 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 42</span> </div>
<div class="line"><span class="lineno"> 43</span> i = 0;</div>
<div class="line"><span class="lineno"> 44</span> j = 0;</div>
<div class="line"><span class="lineno"> 45</span> k = l;</div>
<div class="line"><span class="lineno"> 45</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>;</div>
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">while</span> (i &lt; n1 || j &lt; n2) {</div>
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">if</span> (j &gt;= n2 || (i &lt; n1 &amp;&amp; L[i] &lt;= R[j])) {</div>
<div class="line"><span class="lineno"> 48</span> arr[k] = L[i];</div>
<div class="line"><span class="lineno"> 48</span> arr[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = L[i];</div>
<div class="line"><span class="lineno"> 49</span> i++;</div>
<div class="line"><span class="lineno"> 50</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 51</span> arr[k] = R[j];</div>
<div class="line"><span class="lineno"> 51</span> arr[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = R[j];</div>
<div class="line"><span class="lineno"> 52</span> j++;</div>
<div class="line"><span class="lineno"> 53</span> }</div>
<div class="line"><span class="lineno"> 54</span> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++;</div>
@@ -470,7 +471,7 @@ template&lt;typename T &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d5/df4/merge__sort_8cpp_source.html#l00071">71</a> of file <a class="el" href="../../d5/df4/merge__sort_8cpp_source.html">merge_sort.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 71</span> {</div>
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">if</span> (l &lt; r) {</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordtype">int</span> m = l + (r - l) / 2;</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordtype">int</span> m = <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a> + (r - <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a6d8df83a6f26ce24a75d3b358b7f5b8a">l</a>) / 2;</div>
<div class="line"><span class="lineno"> 74</span> <a class="code hl_function" href="#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, l, m);</div>
<div class="line"><span class="lineno"> 75</span> <a class="code hl_function" href="#gab6b14fea48d9841e29b9fc26be6e05d7">mergeSort</a>(arr, m + 1, r);</div>
<div class="line"><span class="lineno"> 76</span> <a class="code hl_function" href="#ga460c61cd948203b4816bef2accb3fc73">merge</a>(arr, l, m, r);</div>
@@ -526,7 +527,7 @@ template&lt;typename T &gt; </div>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -541,7 +542,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 112</span> d = float(std::rand() % 1000 - 500) / 100.f;</div>
<div class="line"><span class="lineno"> 113</span> }</div>
<div class="line"><span class="lineno"> 114</span> </div>
<div class="line"><span class="lineno"> 115</span> std::vector&lt;float&gt; sorted = sorting::wiggle_sort::wiggleSort&lt;float&gt;(data1);</div>
<div class="line"><span class="lineno"> 115</span> std::vector&lt;float&gt; sorted = <a class="code hl_function" href="../../d1/dcc/wiggle__sort_8cpp.html#a99eeded693ac073717282fae365957a1">sorting::wiggle_sort::wiggleSort&lt;float&gt;</a>(data1);</div>
<div class="line"><span class="lineno"> 116</span> </div>
<div class="line"><span class="lineno"> 117</span> <a class="code hl_function" href="#ga135e4c638e3bcf548bd122b5f49a3e72">displayElements</a>(sorted);</div>
<div class="line"><span class="lineno"> 118</span> </div>
@@ -552,7 +553,8 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 123</span> </div>
<div class="line"><span class="lineno"> 124</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 1 passed\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 125</span>}</div>
<div class="ttc" id="agroup__sorting_html_ga135e4c638e3bcf548bd122b5f49a3e72"><div class="ttname"><a href="#ga135e4c638e3bcf548bd122b5f49a3e72">displayElements</a></div><div class="ttdeci">static void displayElements(const std::vector&lt; T &gt; &amp;arr)</div><div class="ttdoc">Utility function used for printing the elements. Prints elements of the array after they're sorted us...</div><div class="ttdef"><b>Definition</b> <a href="../../d1/dcc/wiggle__sort_8cpp_source.html#l00086">wiggle_sort.cpp:86</a></div></div>
<div class="ttc" id="agroup__sorting_html_ga135e4c638e3bcf548bd122b5f49a3e72"><div class="ttname"><a href="#ga135e4c638e3bcf548bd122b5f49a3e72">displayElements</a></div><div class="ttdeci">static void displayElements(const std::vector&lt; T &gt; &amp;arr)</div><div class="ttdoc">Utility function used for printing the elements. Prints elements of the array after they&#39;re sorted us...</div><div class="ttdef"><b>Definition</b> <a href="../../d1/dcc/wiggle__sort_8cpp_source.html#l00086">wiggle_sort.cpp:86</a></div></div>
<div class="ttc" id="awiggle__sort_8cpp_html_a99eeded693ac073717282fae365957a1"><div class="ttname"><a href="../../d1/dcc/wiggle__sort_8cpp.html#a99eeded693ac073717282fae365957a1">sorting::wiggle_sort::wiggleSort</a></div><div class="ttdeci">std::vector&lt; T &gt; wiggleSort(const std::vector&lt; T &gt; &amp;arr)</div><div class="ttdoc">Function used for sorting the elements in wave form.</div><div class="ttdef"><b>Definition</b> <a href="../../d1/dcc/wiggle__sort_8cpp_source.html#l00054">wiggle_sort.cpp:54</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -561,7 +563,7 @@ template&lt;typename T &gt; </div>
<!-- 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++: 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');
@@ -136,7 +136,7 @@ $(function(){initNavTree('d6/d45/structciphers_1_1elliptic__curve__key__exchange
<!-- 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++: 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');
@@ -144,7 +144,7 @@ $(function(){initNavTree('d0/d58/classgraph_1_1_rooted_tree.html','../../'); ini
<!-- 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++: TestCases 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');
@@ -173,15 +173,15 @@ Public Member Functions</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-methods" name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e" id="r_aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e" id="r_aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a> (T msg)</td></tr>
<tr class="memdesc:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to print given message on console. <br /></td></tr>
<tr class="separator:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e" id="r_aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e" id="r_aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a> (T msg)</td></tr>
<tr class="memdesc:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to print given message on console. <br /></td></tr>
<tr class="separator:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e" id="r_aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e" id="r_aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a> (T msg)</td></tr>
<tr class="memdesc:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to print64_t given message on console. <br /></td></tr>
<tr class="separator:aa3aa3d5bf666f327ee8e2d11d397b06e"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -198,7 +198,7 @@ Private Member Functions</h2></td></tr>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -212,7 +212,7 @@ template&lt;typename T &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">
@@ -240,7 +240,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -254,7 +254,7 @@ template&lt;typename T &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">
@@ -282,7 +282,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
@@ -296,7 +296,7 @@ template&lt;typename T &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">
@@ -336,7 +336,7 @@ template&lt;typename T &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">
@@ -380,7 +380,7 @@ template&lt;typename T &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">
@@ -420,7 +420,7 @@ template&lt;typename T &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">
@@ -460,7 +460,7 @@ template&lt;typename T &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">
@@ -476,7 +476,7 @@ template&lt;typename T &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00259">259</a> of file <a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html">inorder_successor_of_bst.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 259</span> {</div>
<div class="line"><span class="lineno"> 260</span> <span class="keyword">const</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
<div class="line"><span class="lineno"> 260</span> <span class="keyword">const</span> operations_on_datastructures::inorder_traversal_of_bst::Node</div>
<div class="line"><span class="lineno"> 261</span> *expectedOutput = <span class="keyword">nullptr</span>; </div>
<div class="line"><span class="lineno"> 262</span> </div>
<div class="line"><span class="lineno"> 263</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;</span>);</div>
@@ -485,7 +485,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 266</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot; EDGE CASE : Printing inorder successor for last node in the &quot;</span></div>
<div class="line"><span class="lineno"> 267</span> <span class="stringliteral">&quot;BST, Output will be nullptr.&quot;</span>);</div>
<div class="line"><span class="lineno"> 268</span> </div>
<div class="line"><span class="lineno"> 269</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a> *root =</div>
<div class="line"><span class="lineno"> 269</span> operations_on_datastructures::inorder_traversal_of_bst::Node *root =</div>
<div class="line"><span class="lineno"> 270</span> <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 271</span> std::vector&lt;int64_t&gt; node_data{</div>
<div class="line"><span class="lineno"> 272</span> 20, 3, 5, 6, 2, 23, 45, 78, 21}; </div>
@@ -499,7 +499,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 280</span> root); </div>
<div class="line"><span class="lineno"> 281</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 282</span> </div>
<div class="line"><span class="lineno"> 283</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
<div class="line"><span class="lineno"> 283</span> operations_on_datastructures::inorder_traversal_of_bst::Node</div>
<div class="line"><span class="lineno"> 284</span> *inorderSuccessor = operations_on_datastructures::</div>
<div class="line"><span class="lineno"> 285</span> inorder_traversal_of_bst::getInorderSuccessor(</div>
<div class="line"><span class="lineno"> 286</span> root, 78); </div>
@@ -514,7 +514,6 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 295</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;[PASS] : TEST CASE 1 PASS!&quot;</span>);</div>
<div class="line"><span class="lineno"> 296</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;</span>);</div>
<div class="line"><span class="lineno"> 297</span> }</div>
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div><div class="ttdoc">A Node structure representing a single node in BST.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00056">inorder_successor_of_bst.cpp:56</a></div></div>
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a05fe8a029e155c43e4efa598d4d089d9"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a05fe8a029e155c43e4efa598d4d089d9">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a></div><div class="ttdeci">Node * makeBST(Node *root, const std::vector&lt; int64_t &gt; &amp;data)</div><div class="ttdoc">This function is used in test cases to quickly create BST containing large data instead of hard codin...</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00155">inorder_successor_of_bst.cpp:155</a></div></div>
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a5d7266b934ca50c4f53e4f1e725d89a4"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a></div><div class="ttdeci">void printInorder(Node *root)</div><div class="ttdoc">Prints the BST in inorder traversal using recursion.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00136">inorder_successor_of_bst.cpp:136</a></div></div>
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7b20eb99272665c1777949e26ab59589"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a></div><div class="ttdeci">void deallocate(Node *rootNode)</div><div class="ttdoc">This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d32/inorder__successor__of__bst_8cpp_source.html#l00210">inorder_successor_of_bst.cpp:210</a></div></div>
@@ -539,7 +538,7 @@ template&lt;typename T &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">
@@ -569,10 +568,10 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 213</span> 2, 5, 6, 7,</div>
<div class="line"><span class="lineno"> 214</span> 8}; </div>
<div class="line"><span class="lineno"> 215</span> </div>
<div class="line"><span class="lineno"> 216</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><span class="lineno"> 216</span> search::sublist_search::Node *sublistLL =</div>
<div class="line"><span class="lineno"> 217</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><span class="lineno"> 218</span> sublistData); </div>
<div class="line"><span class="lineno"> 219</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><span class="lineno"> 219</span> search::sublist_search::Node *mainlistLL =</div>
<div class="line"><span class="lineno"> 220</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><span class="lineno"> 221</span> mainlistData); </div>
<div class="line"><span class="lineno"> 223</span> </div>
@@ -590,7 +589,6 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 235</span> deleteList(mainlistLL);</div>
<div class="line"><span class="lineno"> 236</span> deleteList(sublistLL);</div>
<div class="line"><span class="lineno"> 237</span> }</div>
<div class="ttc" id="astructsearch_1_1sublist__search_1_1_node_html"><div class="ttname"><a href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a></div><div class="ttdoc">A Node structure representing a single link Node in a linked list.</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d45/sublist__search_8cpp_source.html#l00048">sublist_search.cpp:48</a></div></div>
<div class="ttc" id="asublist__search_8cpp_html_a4faee403e2758aaab682ed6622ae218c"><div class="ttname"><a href="../../d5/d45/sublist__search_8cpp.html#a4faee403e2758aaab682ed6622ae218c">search::sublist_search::sublistSearch</a></div><div class="ttdeci">bool sublistSearch(Node *sublist, Node *mainList)</div><div class="ttdoc">Main searching function.</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d45/sublist__search_8cpp_source.html#l00115">sublist_search.cpp:115</a></div></div>
<div class="ttc" id="asublist__search_8cpp_html_a70ca8d0267008e09cfa50b4e2ddfbe53"><div class="ttname"><a href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a></div><div class="ttdeci">Node * makeLinkedList(const std::vector&lt; uint64_t &gt; &amp;data)</div><div class="ttdoc">Give a vector of data, it adds each element of vector in the linked list and return the address of he...</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d45/sublist__search_8cpp_source.html#l00074">sublist_search.cpp:74</a></div></div>
<div class="ttc" id="aword__break_8cpp_html_a1cc9dd6e6190d10a010fdcdfe7a21a81"><div class="ttname"><a href="../../d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81">dynamic_programming::word_break::exists</a></div><div class="ttdeci">bool exists(const std::string &amp;str, const std::unordered_set&lt; std::string &gt; &amp;strSet)</div><div class="ttdoc">Function that checks if the string passed in param is present in the the unordered_set passed.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d84/word__break_8cpp_source.html#l00060">word_break.cpp:60</a></div></div>
@@ -615,7 +613,7 @@ template&lt;typename T &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">
@@ -672,7 +670,7 @@ template&lt;typename T &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">
@@ -693,7 +691,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 307</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;</span>);</div>
<div class="line"><span class="lineno"> 308</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;This is test case 2 : &quot;</span>);</div>
<div class="line"><span class="lineno"> 309</span> </div>
<div class="line"><span class="lineno"> 310</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a> *root =</div>
<div class="line"><span class="lineno"> 310</span> operations_on_datastructures::inorder_traversal_of_bst::Node *root =</div>
<div class="line"><span class="lineno"> 311</span> <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 312</span> std::vector&lt;int64_t&gt; node_data{</div>
<div class="line"><span class="lineno"> 313</span> 20, 3, 5, 6, 2, 23, 45, 78, 21}; </div>
@@ -707,7 +705,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 321</span> root); </div>
<div class="line"><span class="lineno"> 322</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 323</span> </div>
<div class="line"><span class="lineno"> 324</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
<div class="line"><span class="lineno"> 324</span> operations_on_datastructures::inorder_traversal_of_bst::Node</div>
<div class="line"><span class="lineno"> 325</span> *inorderSuccessor = operations_on_datastructures::</div>
<div class="line"><span class="lineno"> 326</span> inorder_traversal_of_bst::getInorderSuccessor(</div>
<div class="line"><span class="lineno"> 327</span> root, 20); </div>
@@ -744,7 +742,7 @@ template&lt;typename T &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">
@@ -785,10 +783,10 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 267</span> temp++;</div>
<div class="line"><span class="lineno"> 268</span> }</div>
<div class="line"><span class="lineno"> 269</span> </div>
<div class="line"><span class="lineno"> 270</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><span class="lineno"> 270</span> search::sublist_search::Node *sublistLL =</div>
<div class="line"><span class="lineno"> 271</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><span class="lineno"> 272</span> sublistData); </div>
<div class="line"><span class="lineno"> 273</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><span class="lineno"> 273</span> search::sublist_search::Node *mainlistLL =</div>
<div class="line"><span class="lineno"> 274</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><span class="lineno"> 275</span> mainlistData); </div>
<div class="line"><span class="lineno"> 277</span> </div>
@@ -827,7 +825,7 @@ template&lt;typename T &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">
@@ -885,7 +883,7 @@ template&lt;typename T &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">
@@ -906,7 +904,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 348</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;</span>);</div>
<div class="line"><span class="lineno"> 349</span> <a class="code hl_function" href="#aa3aa3d5bf666f327ee8e2d11d397b06e">log</a>(<span class="stringliteral">&quot;This is test case 3 : &quot;</span>);</div>
<div class="line"><span class="lineno"> 350</span> </div>
<div class="line"><span class="lineno"> 351</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a> *root =</div>
<div class="line"><span class="lineno"> 351</span> operations_on_datastructures::inorder_traversal_of_bst::Node *root =</div>
<div class="line"><span class="lineno"> 352</span> <span class="keyword">nullptr</span>;</div>
<div class="line"><span class="lineno"> 353</span> std::vector&lt;int64_t&gt; node_data{</div>
<div class="line"><span class="lineno"> 354</span> 89, 67, 32, 56, 90, 123, 120,</div>
@@ -921,7 +919,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 363</span> root); </div>
<div class="line"><span class="lineno"> 364</span> std::cout &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 365</span> </div>
<div class="line"><span class="lineno"> 366</span> <a class="code hl_class" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
<div class="line"><span class="lineno"> 366</span> operations_on_datastructures::inorder_traversal_of_bst::Node</div>
<div class="line"><span class="lineno"> 367</span> *inorderSuccessor = operations_on_datastructures::</div>
<div class="line"><span class="lineno"> 368</span> inorder_traversal_of_bst::getInorderSuccessor(</div>
<div class="line"><span class="lineno"> 369</span> root, 90); </div>
@@ -957,7 +955,7 @@ template&lt;typename T &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">
@@ -995,10 +993,10 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 318</span> sublistData.push_back(i + 1);</div>
<div class="line"><span class="lineno"> 319</span> }</div>
<div class="line"><span class="lineno"> 320</span> </div>
<div class="line"><span class="lineno"> 321</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *sublistLL =</div>
<div class="line"><span class="lineno"> 321</span> search::sublist_search::Node *sublistLL =</div>
<div class="line"><span class="lineno"> 322</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><span class="lineno"> 323</span> sublistData); </div>
<div class="line"><span class="lineno"> 324</span> <a class="code hl_struct" href="../../da/d61/structsearch_1_1sublist__search_1_1_node.html">search::sublist_search::Node</a> *mainlistLL =</div>
<div class="line"><span class="lineno"> 324</span> search::sublist_search::Node *mainlistLL =</div>
<div class="line"><span class="lineno"> 325</span> <a class="code hl_function" href="../../d5/d45/sublist__search_8cpp.html#a70ca8d0267008e09cfa50b4e2ddfbe53">search::sublist_search::makeLinkedList</a>(</div>
<div class="line"><span class="lineno"> 326</span> mainlistData); </div>
<div class="line"><span class="lineno"> 328</span> </div>
@@ -1037,7 +1035,7 @@ template&lt;typename T &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">
@@ -1088,7 +1086,7 @@ template&lt;typename T &gt; </div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d58/class_test_cases.html">TestCases</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++: range_queries/persistent_seg_tree_lazy_prop.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');
@@ -217,7 +217,7 @@ Functions</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -285,7 +285,7 @@ Functions</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html">persistent_seg_tree_lazy_prop.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++: range_queries/persistent_seg_tree_lazy_prop.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,13 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="headertitle"><div class="title">persistent_seg_tree_lazy_prop.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d58/persistent__seg__tree__lazy__prop_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="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include &lt;memory&gt;</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include &lt;vector&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="../../dd/d69/namespacerange__queries.html">range_queries</a> {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span></div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="};">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html"> 39</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html">perSegTree</a> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">private</span>:</div>
@@ -148,7 +148,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> std::vector&lt;std::shared_ptr&lt;Node&gt;&gt;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a1eac9cf0613dfc8e2b0195009dd5c9d5"> 54</a></span> <a class="code hl_variable" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a1eac9cf0613dfc8e2b0195009dd5c9d5">ptrs</a>{}; </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a8ff495d2f389b4aaa54449c26c6078f3"> 57</a></span> std::vector&lt;int64_t&gt; <a class="code hl_variable" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a8ff495d2f389b4aaa54449c26c6078f3">vec</a>{}; </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span></div>
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a0cec4b77d264521717cf9b0482c45817"> 65</a></span> std::shared_ptr&lt;Node&gt; <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a0cec4b77d264521717cf9b0482c45817">newKid</a>(std::shared_ptr&lt;Node&gt; <span class="keyword">const</span> &amp;curr) {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">auto</span> newNode = std::make_shared&lt;Node&gt;(<a class="code hl_class" href="../../d5/d66/classrange__queries_1_1per_seg_tree_1_1_node.html">Node</a>());</div>
@@ -159,7 +159,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">return</span> newNode;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> }</div>
</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</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="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ace7f57935b3bb9446f11c239fd89ae79"> 83</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ace7f57935b3bb9446f11c239fd89ae79">lazy</a>(<span class="keyword">const</span> uint32_t &amp;i, <span class="keyword">const</span> uint32_t &amp;j,</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> std::shared_ptr&lt;Node&gt; <span class="keyword">const</span> &amp;curr) {</div>
@@ -176,7 +176,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> curr-&gt;prop = 0;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
</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="foldopen00106" data-start="{" data-end="}">
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a6d3f2465a7c5803a1ff16c5378bcc5e4"> 106</a></span> std::shared_ptr&lt;Node&gt; <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a6d3f2465a7c5803a1ff16c5378bcc5e4">construct</a>(<span class="keyword">const</span> uint32_t &amp;i, <span class="keyword">const</span> uint32_t &amp;j) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">auto</span> newNode = std::make_shared&lt;Node&gt;(<a class="code hl_class" href="../../d5/d66/classrange__queries_1_1per_seg_tree_1_1_node.html">Node</a>());</div>
@@ -193,7 +193,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> newNode;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
</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="foldopen" id="foldopen00135" data-start="{" data-end="}">
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a24487eda25123bc4d112e8430821a6c6"> 135</a></span> std::shared_ptr&lt;Node&gt; <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a24487eda25123bc4d112e8430821a6c6">update</a>(<span class="keyword">const</span> uint32_t &amp;i, <span class="keyword">const</span> uint32_t &amp;j,</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">const</span> uint32_t &amp;l, <span class="keyword">const</span> uint32_t &amp;r,</div>
@@ -217,7 +217,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> newNode;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span></div>
<div class="foldopen" id="foldopen00171" data-start="{" data-end="}">
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ae8ae4b1835e5e8aec32f68c5059ed4d4"> 171</a></span> int64_t <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ae8ae4b1835e5e8aec32f68c5059ed4d4">query</a>(<span class="keyword">const</span> uint32_t &amp;i, <span class="keyword">const</span> uint32_t &amp;j, <span class="keyword">const</span> uint32_t &amp;l,</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keyword">const</span> uint32_t &amp;r, std::shared_ptr&lt;Node&gt; <span class="keyword">const</span> &amp;curr) {</div>
@@ -233,7 +233,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ae8ae4b1835e5e8aec32f68c5059ed4d4">query</a>(mid + 1, j, l, r, curr-&gt;right);</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="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keyword">public</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="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ac83bcabf5a8db8b0d8d156a4c1bcd4c3"> 197</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ac83bcabf5a8db8b0d8d156a4c1bcd4c3">construct</a>(<span class="keyword">const</span> std::vector&lt;int64_t&gt;</div>
@@ -249,7 +249,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <a class="code hl_variable" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a1eac9cf0613dfc8e2b0195009dd5c9d5">ptrs</a>.push_back(root);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> }</div>
</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> </div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span></div>
<div class="foldopen" id="foldopen00219" data-start="{" data-end="}">
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#af87494e6cf012d28c4f5b9d1c15f9c5d"> 219</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#af87494e6cf012d28c4f5b9d1c15f9c5d">update</a>(<span class="keyword">const</span> uint32_t &amp;l, <span class="keyword">const</span> uint32_t &amp;r,</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keyword">const</span> int64_t</div>
@@ -262,7 +262,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> 1])); <span class="comment">// saving the root pointer to the new segment tree</span></div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> }</div>
</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> </div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span></div>
<div class="foldopen" id="foldopen00241" data-start="{" data-end="}">
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ad484002bcb701820d55f32ea5d525571"> 241</a></span> int64_t <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ad484002bcb701820d55f32ea5d525571">query</a>(</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keyword">const</span> uint32_t &amp;l, <span class="keyword">const</span> uint32_t &amp;r,</div>
@@ -273,7 +273,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ae8ae4b1835e5e8aec32f68c5059ed4d4">query</a>(0, n - 1, l, r, <a class="code hl_variable" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a1eac9cf0613dfc8e2b0195009dd5c9d5">ptrs</a>[version]);</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> }</div>
</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> </div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span></div>
<div class="foldopen" id="foldopen00255" data-start="{" data-end="}">
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"><a class="line" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a0fe4e431f3e09c274ecd7d2d58dcb865"> 255</a></span> uint32_t <a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#a0fe4e431f3e09c274ecd7d2d58dcb865">size</a>() <span class="comment">// returns the number of segment trees (versions) , the</span></div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="comment">// number of updates done so far = returned value - 1</span></div>
@@ -285,7 +285,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span>};</div>
</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span>} <span class="comment">// namespace range_queries</span></div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> </div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span></div>
<div class="foldopen" id="foldopen00268" data-start="{" data-end="}">
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"><a class="line" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 268</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> std::vector&lt;int64_t&gt; arr = {-5, 2, 3, 11, -2, 7, 0, 1};</div>
@@ -333,7 +333,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> &lt;&lt; tree.<a class="code hl_function" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html#ae8ae4b1835e5e8aec32f68c5059ed4d4">query</a>(3, 5, 1) &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span>}</div>
</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> </div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span></div>
<div class="foldopen" id="foldopen00318" data-start="{" data-end="}">
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"><a class="line" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 318</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <a class="code hl_function" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -364,7 +364,7 @@ $(function(){initNavTree('d5/d58/persistent__seg__tree__lazy__prop_8cpp_source.h
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d5/d58/persistent__seg__tree__lazy__prop_8cpp.html">persistent_seg_tree_lazy_prop.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: sorting/random_pivot_quick_sort.cpp Pages: 1 -->
<svg width="370pt" 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: sorting/random_pivot_quick_sort.cpp Pages: 1 -->
<svg width="370pt" height="94pt"

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.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: math/integral_approximation2.cpp Pages: 1 -->
<svg width="448pt" height="83pt"

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.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: math/integral_approximation2.cpp Pages: 1 -->
<svg width="448pt" height="83pt"

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.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++: geometry 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');
@@ -137,7 +137,7 @@ $(function(){initNavTree('d5/d5f/namespacegeometry.html','../../'); initResizabl
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d5f/namespacegeometry.html">geometry</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++: range_queries::perSegTree::Node 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');
@@ -227,7 +227,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dd/d69/namespacerange__queries.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d8/d28/classrange__queries_1_1per_seg_tree.html">perSegTree</a></li><li class="navelem"><a class="el" href="../../d5/d66/classrange__queries_1_1per_seg_tree_1_1_node.html">Node</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.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/bayes_theorem.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');
@@ -255,7 +255,7 @@ Note that \(P(A|B)\) is read 'The probability of A given that the event B has oc
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d5/d67/bayes__theorem_8cpp.html">bayes_theorem.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++: probability/bayes_theorem.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,21 +124,21 @@ $(function(){initNavTree('d5/d67/bayes__theorem_8cpp_source.html','../../'); ini
<div class="headertitle"><div class="title">bayes_theorem.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d67/bayes__theorem_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="../../d5/d67/bayes__theorem_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</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="../../d5/d67/bayes__theorem_8cpp.html#a655bfe51252468d232dc639a340656ba"> 14</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d5/d67/bayes__theorem_8cpp.html#a655bfe51252468d232dc639a340656ba">bayes_AgivenB</a>(<span class="keywordtype">double</span> BgivenA, <span class="keywordtype">double</span> A, <span class="keywordtype">double</span> B) {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">return</span> (BgivenA * A) / B;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span>}</div>
</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span></div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="}">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../d5/d67/bayes__theorem_8cpp.html#abb4f22dc05887c2259fdfc55c687598f"> 20</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d5/d67/bayes__theorem_8cpp.html#abb4f22dc05887c2259fdfc55c687598f">bayes_BgivenA</a>(<span class="keywordtype">double</span> AgivenB, <span class="keywordtype">double</span> A, <span class="keywordtype">double</span> B) {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">return</span> (AgivenB * B) / A;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>}</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="}">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../d5/d67/bayes__theorem_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 26</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d67/bayes__theorem_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">double</span> A = 0.01;</div>
@@ -159,7 +159,7 @@ $(function(){initNavTree('d5/d67/bayes__theorem_8cpp_source.html','../../'); ini
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_82e494173a87936756866de2fa774307.html">probability</a></li><li class="navelem"><a class="el" href="../../d5/d67/bayes__theorem_8cpp.html">bayes_theorem.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++: math/complex_numbers.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');
@@ -389,7 +389,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="../../d5/d67/complex__numbers_8cpp.html">complex_numbers.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++: math/complex_numbers.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,16 +124,17 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
<div class="headertitle"><div class="title">complex_numbers.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d67/complex__numbers_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="../../d5/d67/complex__numbers_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;complex&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &lt;ctime&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &lt;stdexcept&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html"> 20</a></span><span class="keyword">class </span><a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html"> 20</a></span><span class="keyword">class </span><a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// The real value of the complex number</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">double</span> re;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// The imaginary value of the complex number</span></div>
@@ -152,53 +153,53 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> im = x * std::sin(y);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> }</div>
</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a466cd7b664cc6a864937ceb3dead1323"> 58</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a466cd7b664cc6a864937ceb3dead1323">Complex</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;other) : re(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>()), im(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>()) {}</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a466cd7b664cc6a864937ceb3dead1323"> 58</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a466cd7b664cc6a864937ceb3dead1323">Complex</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;other) : re(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>()), im(other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>()) {}</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6"> 64</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;re; }</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="l00070" name="l00070"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974"> 70</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;im; }</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span></div>
<div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#ae5b51b749ea4964104b9527af9d8f556"> 79</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#ae5b51b749ea4964104b9527af9d8f556">abs</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> std::sqrt(this-&gt;re * this-&gt;re + this-&gt;im * this-&gt;im);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#ae1e03712837450549e0c9b4017533a41"> 87</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#ae1e03712837450549e0c9b4017533a41">arg</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> std::atan2(this-&gt;im, this-&gt;re); }</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="foldopen" id="foldopen00095" data-start="{" data-end="}">
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a820afcbb330df716577459d7a3aa3a1c"> 95</a></span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#a820afcbb330df716577459d7a3aa3a1c">operator+</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> result(this-&gt;re + other.re, this-&gt;im + other.im);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a820afcbb330df716577459d7a3aa3a1c"> 95</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#a820afcbb330df716577459d7a3aa3a1c">operator+</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> result(this-&gt;re + other.re, this-&gt;im + other.im);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</div>
</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span></div>
<div class="foldopen" id="foldopen00106" data-start="{" data-end="}">
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a36739619a07b5478bcd8a28ad2f8b7da"> 106</a></span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#a36739619a07b5478bcd8a28ad2f8b7da">operator-</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> result(this-&gt;re - other.re, this-&gt;im - other.im);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a36739619a07b5478bcd8a28ad2f8b7da"> 106</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#a36739619a07b5478bcd8a28ad2f8b7da">operator-</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> result(this-&gt;re - other.re, this-&gt;im - other.im);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">return</span> result;</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="foldopen00117" data-start="{" data-end="}">
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#aa9b4a7d6083ca7040ddd4fe93db5c19d"> 117</a></span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#aa9b4a7d6083ca7040ddd4fe93db5c19d">operator*</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> result(this-&gt;re * other.re - this-&gt;im * other.im,</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#aa9b4a7d6083ca7040ddd4fe93db5c19d"> 117</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#aa9b4a7d6083ca7040ddd4fe93db5c19d">operator*</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> result(this-&gt;re * other.re - this-&gt;im * other.im,</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> this-&gt;re * other.im + this-&gt;im * other.re);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span></div>
<div class="foldopen" id="foldopen00130" data-start="{" data-end="}">
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a8d5427f6c42c15283031d73e1418c59d"> 130</a></span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#a8d5427f6c42c15283031d73e1418c59d">operator~</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> result(this-&gt;re, -(this-&gt;im));</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a8d5427f6c42c15283031d73e1418c59d"> 130</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#a8d5427f6c42c15283031d73e1418c59d">operator~</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> result(this-&gt;re, -(this-&gt;im));</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">return</span> result;</div>
<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 class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span></div>
<div class="foldopen" id="foldopen00142" data-start="{" data-end="}">
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#ac38437c10eb798f176c384a695171b90"> 142</a></span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#ac38437c10eb798f176c384a695171b90">operator/</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> result = *<span class="keyword">this</span> * ~other;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#ac38437c10eb798f176c384a695171b90"> 142</a></span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> <a class="code hl_function" href="../../da/d5a/class_complex.html#ac38437c10eb798f176c384a695171b90">operator/</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> result = *<span class="keyword">this</span> * ~other;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordtype">double</span> denominator =</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() * other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() + other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>() * other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">if</span> (denominator != 0) {</div>
@@ -210,9 +211,9 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
<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> }</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span></div>
<div class="foldopen" id="foldopen00160" data-start="{" data-end="}">
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a4ac9f529d54cacf2969f2c7179b4c4ac"> 160</a></span> <span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;<a class="code hl_function" href="../../da/d5a/class_complex.html#a4ac9f529d54cacf2969f2c7179b4c4ac">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="../../da/d5a/class_complex.html#a4ac9f529d54cacf2969f2c7179b4c4ac"> 160</a></span> <span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;<a class="code hl_function" href="../../da/d5a/class_complex.html#a4ac9f529d54cacf2969f2c7179b4c4ac">operator=</a>(<span class="keyword">const</span> <a class="code hl_function" href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex</a> &amp;other) {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> this-&gt;re = other.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>();</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> this-&gt;im = other.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
@@ -220,13 +221,13 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>};</div>
</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span></div>
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="../../d5/d67/complex__numbers_8cpp.html#a5a73e9d4e68af8cedb95bd0864054b89"> 175</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d5/d67/complex__numbers_8cpp.html#a5a73e9d4e68af8cedb95bd0864054b89">operator==</a>(<span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;a, <span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;b) {</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordflow">return</span> a.real() == b.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>() &amp;&amp; a.imag() == b.<a class="code hl_function" href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">imag</a>();</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span>}</div>
</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</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="../../d5/d67/complex__numbers_8cpp.html#a44d5f25b573e870accdf26fd32b8484d"> 186</a></span>std::ostream &amp;<a class="code hl_function" href="../../d5/d67/complex__numbers_8cpp.html#a44d5f25b573e870accdf26fd32b8484d">operator&lt;&lt;</a>(std::ostream &amp;os, <span class="keyword">const</span> <a class="code hl_class" href="../../da/d5a/class_complex.html">Complex</a> &amp;num) {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> os &lt;&lt; <span class="stringliteral">&quot;(&quot;</span> &lt;&lt; num.<a class="code hl_function" href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">real</a>();</div>
@@ -239,9 +240,9 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">return</span> os;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span>}</div>
</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"><a class="line" href="../../d5/d67/complex__numbers_8cpp.html#a5d4d5b8250b50703de888514c8e7a7a0"> 201</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d5/d67/complex__numbers_8cpp.html#a5d4d5b8250b50703de888514c8e7a7a0">get_rand</a>() { <span class="keywordflow">return</span> (std::rand() % 100 - 50) / 100.f; }</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> </div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span></div>
<div class="foldopen" id="foldopen00206" data-start="{" data-end="}">
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"><a class="line" href="../../d5/d67/complex__numbers_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9"> 206</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d67/complex__numbers_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>() {</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> std::srand(std::time(<span class="keyword">nullptr</span>));</div>
@@ -302,7 +303,7 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Seventh test passes.\n&quot;</span>;</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span>}</div>
</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> </div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span></div>
<div class="foldopen" id="foldopen00268" data-start="{" data-end="}">
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"><a class="line" href="../../d5/d67/complex__numbers_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 268</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d67/complex__numbers_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> <a class="code hl_function" href="../../d5/d67/complex__numbers_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
@@ -311,19 +312,19 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
</div>
<div class="ttc" id="aclass_complex_html"><div class="ttname"><a href="../../da/d5a/class_complex.html">Complex</a></div><div class="ttdoc">Class Complex to represent complex numbers as a field.</div><div class="ttdef"><b>Definition</b> <a href="#l00020">complex_numbers.cpp:20</a></div></div>
<div class="ttc" id="aclass_complex_html_a312e4b19146128408fb06e0150b0faf6"><div class="ttname"><a href="../../da/d5a/class_complex.html#a312e4b19146128408fb06e0150b0faf6">Complex::real</a></div><div class="ttdeci">double real() const</div><div class="ttdoc">Member function to get real value of our complex number. Member function (getter) to access the class...</div><div class="ttdef"><b>Definition</b> <a href="#l00064">complex_numbers.cpp:64</a></div></div>
<div class="ttc" id="aclass_complex_html_a36739619a07b5478bcd8a28ad2f8b7da"><div class="ttname"><a href="../../da/d5a/class_complex.html#a36739619a07b5478bcd8a28ad2f8b7da">Complex::operator-</a></div><div class="ttdeci">Complex operator-(const Complex &amp;other)</div><div class="ttdoc">Operator overload of '-' on Complex class. Operator overload to be able to subtract two complex numbe...</div><div class="ttdef"><b>Definition</b> <a href="#l00106">complex_numbers.cpp:106</a></div></div>
<div class="ttc" id="aclass_complex_html_a36739619a07b5478bcd8a28ad2f8b7da"><div class="ttname"><a href="../../da/d5a/class_complex.html#a36739619a07b5478bcd8a28ad2f8b7da">Complex::operator-</a></div><div class="ttdeci">Complex operator-(const Complex &amp;other)</div><div class="ttdoc">Operator overload of &#39;-&#39; on Complex class. Operator overload to be able to subtract two complex numbe...</div><div class="ttdef"><b>Definition</b> <a href="#l00106">complex_numbers.cpp:106</a></div></div>
<div class="ttc" id="aclass_complex_html_a3cfc522c782726f49ee20af17b77f867"><div class="ttname"><a href="../../da/d5a/class_complex.html#a3cfc522c782726f49ee20af17b77f867">Complex::Complex</a></div><div class="ttdeci">Complex(double x=0.f, double y=0.f, bool is_polar=false)</div><div class="ttdoc">Complex Constructor which initialises our complex number.</div><div class="ttdef"><b>Definition</b> <a href="#l00043">complex_numbers.cpp:43</a></div></div>
<div class="ttc" id="aclass_complex_html_a466cd7b664cc6a864937ceb3dead1323"><div class="ttname"><a href="../../da/d5a/class_complex.html#a466cd7b664cc6a864937ceb3dead1323">Complex::Complex</a></div><div class="ttdeci">Complex(const Complex &amp;other)</div><div class="ttdoc">Copy Constructor.</div><div class="ttdef"><b>Definition</b> <a href="#l00058">complex_numbers.cpp:58</a></div></div>
<div class="ttc" id="aclass_complex_html_a4ac9f529d54cacf2969f2c7179b4c4ac"><div class="ttname"><a href="../../da/d5a/class_complex.html#a4ac9f529d54cacf2969f2c7179b4c4ac">Complex::operator=</a></div><div class="ttdeci">const Complex &amp; operator=(const Complex &amp;other)</div><div class="ttdoc">Operator overload of '=' on Complex class. Operator overload to be able to copy RHS instance of Compl...</div><div class="ttdef"><b>Definition</b> <a href="#l00160">complex_numbers.cpp:160</a></div></div>
<div class="ttc" id="aclass_complex_html_a820afcbb330df716577459d7a3aa3a1c"><div class="ttname"><a href="../../da/d5a/class_complex.html#a820afcbb330df716577459d7a3aa3a1c">Complex::operator+</a></div><div class="ttdeci">Complex operator+(const Complex &amp;other)</div><div class="ttdoc">Operator overload of '+' on Complex class. Operator overload to be able to add two complex numbers.</div><div class="ttdef"><b>Definition</b> <a href="#l00095">complex_numbers.cpp:95</a></div></div>
<div class="ttc" id="aclass_complex_html_a8d5427f6c42c15283031d73e1418c59d"><div class="ttname"><a href="../../da/d5a/class_complex.html#a8d5427f6c42c15283031d73e1418c59d">Complex::operator~</a></div><div class="ttdeci">Complex operator~() const</div><div class="ttdoc">Operator overload of '~' on Complex class. Operator overload of the BITWISE NOT which gives us the co...</div><div class="ttdef"><b>Definition</b> <a href="#l00130">complex_numbers.cpp:130</a></div></div>
<div class="ttc" id="aclass_complex_html_aa9b4a7d6083ca7040ddd4fe93db5c19d"><div class="ttname"><a href="../../da/d5a/class_complex.html#aa9b4a7d6083ca7040ddd4fe93db5c19d">Complex::operator*</a></div><div class="ttdeci">Complex operator*(const Complex &amp;other)</div><div class="ttdoc">Operator overload of '*' on Complex class. Operator overload to be able to multiple two complex numbe...</div><div class="ttdef"><b>Definition</b> <a href="#l00117">complex_numbers.cpp:117</a></div></div>
<div class="ttc" id="aclass_complex_html_ac38437c10eb798f176c384a695171b90"><div class="ttname"><a href="../../da/d5a/class_complex.html#ac38437c10eb798f176c384a695171b90">Complex::operator/</a></div><div class="ttdeci">Complex operator/(const Complex &amp;other)</div><div class="ttdoc">Operator overload of '/' on Complex class. Operator overload to be able to divide two complex numbers...</div><div class="ttdef"><b>Definition</b> <a href="#l00142">complex_numbers.cpp:142</a></div></div>
<div class="ttc" id="aclass_complex_html_a4ac9f529d54cacf2969f2c7179b4c4ac"><div class="ttname"><a href="../../da/d5a/class_complex.html#a4ac9f529d54cacf2969f2c7179b4c4ac">Complex::operator=</a></div><div class="ttdeci">const Complex &amp; operator=(const Complex &amp;other)</div><div class="ttdoc">Operator overload of &#39;=&#39; on Complex class. Operator overload to be able to copy RHS instance of Compl...</div><div class="ttdef"><b>Definition</b> <a href="#l00160">complex_numbers.cpp:160</a></div></div>
<div class="ttc" id="aclass_complex_html_a820afcbb330df716577459d7a3aa3a1c"><div class="ttname"><a href="../../da/d5a/class_complex.html#a820afcbb330df716577459d7a3aa3a1c">Complex::operator+</a></div><div class="ttdeci">Complex operator+(const Complex &amp;other)</div><div class="ttdoc">Operator overload of &#39;+&#39; on Complex class. Operator overload to be able to add two complex numbers.</div><div class="ttdef"><b>Definition</b> <a href="#l00095">complex_numbers.cpp:95</a></div></div>
<div class="ttc" id="aclass_complex_html_a8d5427f6c42c15283031d73e1418c59d"><div class="ttname"><a href="../../da/d5a/class_complex.html#a8d5427f6c42c15283031d73e1418c59d">Complex::operator~</a></div><div class="ttdeci">Complex operator~() const</div><div class="ttdoc">Operator overload of &#39;~&#39; on Complex class. Operator overload of the BITWISE NOT which gives us the co...</div><div class="ttdef"><b>Definition</b> <a href="#l00130">complex_numbers.cpp:130</a></div></div>
<div class="ttc" id="aclass_complex_html_aa9b4a7d6083ca7040ddd4fe93db5c19d"><div class="ttname"><a href="../../da/d5a/class_complex.html#aa9b4a7d6083ca7040ddd4fe93db5c19d">Complex::operator*</a></div><div class="ttdeci">Complex operator*(const Complex &amp;other)</div><div class="ttdoc">Operator overload of &#39;*&#39; on Complex class. Operator overload to be able to multiple two complex numbe...</div><div class="ttdef"><b>Definition</b> <a href="#l00117">complex_numbers.cpp:117</a></div></div>
<div class="ttc" id="aclass_complex_html_ac38437c10eb798f176c384a695171b90"><div class="ttname"><a href="../../da/d5a/class_complex.html#ac38437c10eb798f176c384a695171b90">Complex::operator/</a></div><div class="ttdeci">Complex operator/(const Complex &amp;other)</div><div class="ttdoc">Operator overload of &#39;/&#39; on Complex class. Operator overload to be able to divide two complex numbers...</div><div class="ttdef"><b>Definition</b> <a href="#l00142">complex_numbers.cpp:142</a></div></div>
<div class="ttc" id="aclass_complex_html_ae1e03712837450549e0c9b4017533a41"><div class="ttname"><a href="../../da/d5a/class_complex.html#ae1e03712837450549e0c9b4017533a41">Complex::arg</a></div><div class="ttdeci">double arg() const</div><div class="ttdoc">Member function to give the argument of our complex number.</div><div class="ttdef"><b>Definition</b> <a href="#l00087">complex_numbers.cpp:87</a></div></div>
<div class="ttc" id="aclass_complex_html_ae5b51b749ea4964104b9527af9d8f556"><div class="ttname"><a href="../../da/d5a/class_complex.html#ae5b51b749ea4964104b9527af9d8f556">Complex::abs</a></div><div class="ttdeci">double abs() const</div><div class="ttdoc">Member function to give the modulus of our complex number. Member function to which gives the absolut...</div><div class="ttdef"><b>Definition</b> <a href="#l00079">complex_numbers.cpp:79</a></div></div>
<div class="ttc" id="aclass_complex_html_af8aacf982e2e6c142921bc850f6dc974"><div class="ttname"><a href="../../da/d5a/class_complex.html#af8aacf982e2e6c142921bc850f6dc974">Complex::imag</a></div><div class="ttdeci">double imag() const</div><div class="ttdoc">Member function to get imaginary value of our complex number. Member function (getter) to access the ...</div><div class="ttdef"><b>Definition</b> <a href="#l00070">complex_numbers.cpp:70</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_a44d5f25b573e870accdf26fd32b8484d"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#a44d5f25b573e870accdf26fd32b8484d">operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const Complex &amp;num)</div><div class="ttdoc">Operator overload of '&lt;&lt;' of ostream for Complex class. Overloaded insersion operator to accommodate ...</div><div class="ttdef"><b>Definition</b> <a href="#l00186">complex_numbers.cpp:186</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_a5a73e9d4e68af8cedb95bd0864054b89"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#a5a73e9d4e68af8cedb95bd0864054b89">operator==</a></div><div class="ttdeci">bool operator==(const Complex &amp;a, const Complex &amp;b)</div><div class="ttdoc">Operator overload of '==' on Complex class. Logical Equal overload for our Complex class.</div><div class="ttdef"><b>Definition</b> <a href="#l00175">complex_numbers.cpp:175</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_a44d5f25b573e870accdf26fd32b8484d"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#a44d5f25b573e870accdf26fd32b8484d">operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const Complex &amp;num)</div><div class="ttdoc">Operator overload of &#39;&lt;&lt;&#39; of ostream for Complex class. Overloaded insersion operator to accommodate ...</div><div class="ttdef"><b>Definition</b> <a href="#l00186">complex_numbers.cpp:186</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_a5a73e9d4e68af8cedb95bd0864054b89"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#a5a73e9d4e68af8cedb95bd0864054b89">operator==</a></div><div class="ttdeci">bool operator==(const Complex &amp;a, const Complex &amp;b)</div><div class="ttdoc">Operator overload of &#39;==&#39; on Complex class. Logical Equal overload for our Complex class.</div><div class="ttdef"><b>Definition</b> <a href="#l00175">complex_numbers.cpp:175</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_a5d4d5b8250b50703de888514c8e7a7a0"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#a5d4d5b8250b50703de888514c8e7a7a0">get_rand</a></div><div class="ttdeci">double get_rand()</div><div class="ttdoc">Function to get random numbers to generate our complex numbers for test.</div><div class="ttdef"><b>Definition</b> <a href="#l00201">complex_numbers.cpp:201</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> <a href="#l00206">complex_numbers.cpp:206</a></div></div>
<div class="ttc" id="acomplex__numbers_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d5/d67/complex__numbers_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00268">complex_numbers.cpp:268</a></div></div>
@@ -333,7 +334,7 @@ $(function(){initNavTree('d5/d67/complex__numbers_8cpp_source.html','../../'); i
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d5/d67/complex__numbers_8cpp.html">complex_numbers.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: catalan_numbers Pages: 1 -->
<svg width="103pt" height="105pt"

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.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: catalan_numbers Pages: 1 -->
<svg width="103pt" height="105pt"

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.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: greedy_algorithms/jump_game.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: greedy_algorithms/jump_game.cpp Pages: 1 -->
<svg width="189pt" height="94pt"

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 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/largest_power.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');
@@ -214,7 +214,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">
@@ -254,7 +254,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="../../d5/d7a/largest__power_8cpp.html">largest_power.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 largest__power_8cpp =
[
[ "largestPower", "d5/d7a/largest__power_8cpp.html#afa39ec943a4836c878e1614fd89b146f", null ],
[ "math::largestPower", "dd/d47/namespacemath.html#afa39ec943a4836c878e1614fd89b146f", null ],
[ "main", "d5/d7a/largest__power_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "test", "d5/d7a/largest__power_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/largest_power.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('d5/d7a/largest__power_8cpp_source.html','../../'); ini
<div class="headertitle"><div class="title">largest_power.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d7a/largest__power_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="../../d5/d7a/largest__power_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</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="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../dd/d47/namespacemath.html#afa39ec943a4836c878e1614fd89b146f"> 29</a></span>uint64_t <a class="code hl_function" href="../../dd/d47/namespacemath.html#afa39ec943a4836c878e1614fd89b146f">largestPower</a>(uint32_t n, <span class="keyword">const</span> uint16_t&amp; p) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="comment">// Initialize result</span></div>
@@ -145,7 +146,7 @@ $(function(){initNavTree('d5/d7a/largest__power_8cpp_source.html','../../'); ini
</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span>} <span class="comment">// namespace math</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span></div>
<div class="foldopen" id="foldopen00048" data-start="{" data-end="}">
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../d5/d7a/largest__power_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 48</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d7a/largest__power_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> uint8_t test_case_1 = <a class="code hl_function" href="../../dd/d47/namespacemath.html#afa39ec943a4836c878e1614fd89b146f">math::largestPower</a>(5, 2);</div>
@@ -169,7 +170,7 @@ $(function(){initNavTree('d5/d7a/largest__power_8cpp_source.html','../../'); ini
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Test 5 Passed!&quot;</span> &lt;&lt; std::endl;</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="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span></div>
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d5/d7a/largest__power_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 74</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d7a/largest__power_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_function" href="../../d5/d7a/largest__power_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
@@ -186,7 +187,7 @@ $(function(){initNavTree('d5/d7a/largest__power_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_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d5/d7a/largest__power_8cpp.html">largest_power.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: dynamic_programming/trapped_rainwater.cpp Pages: 1 -->
<svg width="320pt" height="94pt"

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.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: dynamic_programming/trapped_rainwater.cpp Pages: 1 -->
<svg width="320pt" height="94pt"

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 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/edit_distance.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');
@@ -219,7 +219,7 @@ $(function(){initNavTree('d5/d82/edit__distance_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_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><b>edit_distance.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++: math/lcm_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');
@@ -216,7 +216,7 @@ Functions</h2></td></tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -262,7 +262,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="../../d5/d83/lcm__sum_8cpp.html">lcm_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 lcm__sum_8cpp =
[
[ "lcmSum", "d5/d83/lcm__sum_8cpp.html#a04065193d190d605e1f0d0d93a87e244", null ],
[ "math::lcmSum", "dd/d47/namespacemath.html#a04065193d190d605e1f0d0d93a87e244", null ],
[ "main", "d5/d83/lcm__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "test", "d5/d83/lcm__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++: math/lcm_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,12 +124,13 @@ $(function(){initNavTree('d5/d83/lcm__sum_8cpp_source.html','../../'); initResiz
<div class="headertitle"><div class="title">lcm_sum.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d83/lcm__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="../../d5/d83/lcm__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="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &lt;vector&gt;</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="}">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../dd/d47/namespacemath.html#a04065193d190d605e1f0d0d93a87e244"> 30</a></span>uint64_t <a class="code hl_function" href="../../dd/d47/namespacemath.html#a04065193d190d605e1f0d0d93a87e244">lcmSum</a>(<span class="keyword">const</span> uint16_t&amp; num) {</div>
@@ -163,7 +164,7 @@ $(function(){initNavTree('d5/d83/lcm__sum_8cpp_source.html','../../'); initResiz
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>}</div>
</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>} <span class="comment">// namespace math</span></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="foldopen00066" data-start="{" data-end="}">
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="../../d5/d83/lcm__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 66</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d83/lcm__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> uint64_t n = 2;</div>
@@ -192,7 +193,7 @@ $(function(){initNavTree('d5/d83/lcm__sum_8cpp_source.html','../../'); initResiz
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Passed Test 5!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span>}</div>
</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="foldopen" id="foldopen00097" data-start="{" data-end="}">
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="../../d5/d83/lcm__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 97</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d83/lcm__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_function" href="../../d5/d83/lcm__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
@@ -212,7 +213,7 @@ $(function(){initNavTree('d5/d83/lcm__sum_8cpp_source.html','../../'); initResiz
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../d5/d83/lcm__sum_8cpp.html">lcm_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,149 @@
<!-- 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('d8/df2/classadaline.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">adaline Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="../../d8/df2/classadaline.html">adaline</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#aa23d60262f917f35836ef4b1c1d9f7d3">accuracy</a></td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#a082f758fb55fe19f22b3df66f89b2325">activation</a>(double x)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#a0acbe32aaab897e7939e5b0454035b8c">adaline</a>(int num_features, const double eta=0.01f, const double accuracy=1e-5)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#ac8a9c2aaaa63b0f27ea176857e1e7d56">check_size_match</a>(const std::vector&lt; double &gt; &amp;x)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">private</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#a28160d17e492597a2f112e0d38551cda">eta</a></td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">private</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#a74e3c6c037b67895014414c5d75465e5">fit</a>(const std::vector&lt; double &gt; &amp;x, const int &amp;y)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#a8d61f9ed872eef26bca39388cbda6a91">fit</a>(std::array&lt; std::vector&lt; double &gt;, N &gt; const &amp;X, std::array&lt; int, N &gt; const &amp;Y)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#ae347040516e995c8fb8ca2e5c0496daa">operator&lt;&lt;</a>(std::ostream &amp;out, const adaline &amp;ada)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">friend</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#ab11242d9ad5b03a75911e29b04f78fd3">predict</a>(const std::vector&lt; double &gt; &amp;x, double *out=nullptr)</td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="../../d8/df2/classadaline.html#a4cd8fe438032fedaa66f93bfd66f5492">weights</a></td><td class="entry"><a class="el" href="../../d8/df2/classadaline.html">adaline</a></td><td class="entry"><span class="mlabel">private</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

@@ -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/xor_cipher.cpp Pages: 1 -->
<svg width="186pt" 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: ciphers/xor_cipher.cpp Pages: 1 -->
<svg width="186pt" 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++: Backtracking</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');
@@ -595,7 +595,7 @@ Strings</h1>
<!-- 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++: palindrome_partitioning 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('d5/d89/namespacepalindrome__partitioning.html','../../
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d89/namespacepalindrome__partitioning.html">palindrome_partitioning</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::postfix_expression::Stack 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');
@@ -196,7 +196,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d0/d6f/namespaceothers.html">others</a></li><li class="navelem"><b>postfix_expression</b></li><li class="navelem"><a class="el" href="../../d5/d8a/classothers_1_1postfix__expression_1_1_stack.html">Stack</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/trie_using_hashmap.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');
@@ -224,7 +224,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">
@@ -364,7 +364,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="../../d5/d8a/trie__using__hashmap_8cpp.html">trie_using_hashmap.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/trie_using_hashmap.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,20 +124,20 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="headertitle"><div class="title">trie_using_hashmap.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d8a/trie__using__hashmap_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="../../d5/d8a/trie__using__hashmap_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><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;iostream&gt;</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &lt;memory&gt;</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &lt;stack&gt;</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include &lt;unordered_map&gt;</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &lt;vector&gt;</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d3c/namespacedata__structures.html">data_structures</a> {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d0a/namespacetrie__using__hashmap.html">trie_using_hashmap</a> {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span></div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="};">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html"> 39</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html">Trie</a> {</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html"> 39</a></span><span class="keyword">class </span><a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a092d0805a9e647c2048777dbe67b35ab">Trie</a> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">private</span>:</div>
<div class="foldopen" id="foldopen00044" data-start="{" data-end="};">
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html"> 44</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html">Node</a> {</div>
@@ -152,7 +152,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a092d0805a9e647c2048777dbe67b35ab"> 56</a></span> <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a092d0805a9e647c2048777dbe67b35ab">Trie</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span></div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#abcae0a4456e7f583ce716e3ef466dfd2"> 62</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#abcae0a4456e7f583ce716e3ef466dfd2">insert</a>(<span class="keyword">const</span> std::string&amp; word) {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> std::shared_ptr&lt;Node&gt; curr = <a class="code hl_variable" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a832072498abeaa52ad43c4fc99cba248">root_node</a>;</div>
@@ -168,7 +168,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> }</div>
</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="foldopen" id="foldopen00082" data-start="{" data-end="}">
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ad71eb24207c28b546631802dba97310f"> 82</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ad71eb24207c28b546631802dba97310f">search</a>(<span class="keyword">const</span> std::string&amp; word) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> std::shared_ptr&lt;Node&gt; curr = <a class="code hl_variable" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a832072498abeaa52ad43c4fc99cba248">root_node</a>;</div>
@@ -189,7 +189,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> }</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="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span></div>
<div class="foldopen" id="foldopen00107" data-start="{" data-end="}">
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#af3aee573fbabd2c1510c0f74f842dd17"> 107</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#af3aee573fbabd2c1510c0f74f842dd17">startwith</a>(<span class="keyword">const</span> std::string&amp; prefix) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::shared_ptr&lt;Node&gt; curr = <a class="code hl_variable" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a832072498abeaa52ad43c4fc99cba248">root_node</a>;</div>
@@ -202,7 +202,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> }</div>
</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span></div>
<div class="foldopen" id="foldopen00122" data-start="{" data-end="}">
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ac0bf3d6791cba144b3f539835d835e75"> 122</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ac0bf3d6791cba144b3f539835d835e75">delete_word</a>(std::string word) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> std::shared_ptr&lt;Node&gt; curr = <a class="code hl_variable" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a832072498abeaa52ad43c4fc99cba248">root_node</a>;</div>
@@ -233,7 +233,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<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> }</div>
</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span></div>
<div class="foldopen" id="foldopen00160" data-start="{" data-end="}">
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a7bbe538c8015e8ce158e7ed43f605ebd"> 160</a></span> std::vector&lt;std::string&gt; <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a7bbe538c8015e8ce158e7ed43f605ebd">get_all_words</a>(std::vector&lt;std::string&gt; results,</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keyword">const</span> std::shared_ptr&lt;Node&gt;&amp; element,</div>
@@ -258,7 +258,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="keywordflow">return</span> results;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> }</div>
</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> </div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span></div>
<div class="foldopen" id="foldopen00188" data-start="{" data-end="}">
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ae15fdc7f2b5023992d87a711d78566c4"> 188</a></span> std::vector&lt;std::string&gt; <a class="code hl_function" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ae15fdc7f2b5023992d87a711d78566c4">predict_words</a>(<span class="keyword">const</span> std::string&amp; prefix) {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> std::vector&lt;std::string&gt; result;</div>
@@ -290,7 +290,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span>} <span class="comment">// namespace trie_using_hashmap</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span>} <span class="comment">// namespace data_structures</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span></div>
<div class="foldopen" id="foldopen00221" data-start="{" data-end="}">
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"><a class="line" href="../../d5/d8a/trie__using__hashmap_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 221</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d8a/trie__using__hashmap_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <a class="code hl_class" href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html">data_structures::trie_using_hashmap::Trie</a> obj;</div>
@@ -409,7 +409,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> std::cout &lt;&lt; <span class="stringliteral">&quot;All tests passed&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span>}</div>
</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> </div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span></div>
<div class="foldopen" id="foldopen00342" data-start="{" data-end="}">
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"><a class="line" href="../../d5/d8a/trie__using__hashmap_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 342</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d8a/trie__using__hashmap_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> <a class="code hl_function" href="../../d5/d8a/trie__using__hashmap_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementaions</span></div>
@@ -418,7 +418,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_8cpp_source.html','../../'
</div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html">data_structures::trie_using_hashmap::Trie</a></div><div class="ttdoc">Trie class, implementation of trie using hashmap in each trie node for all the characters of char16_t...</div><div class="ttdef"><b>Definition</b> <a href="#l00039">trie_using_hashmap.cpp:39</a></div></div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_a092d0805a9e647c2048777dbe67b35ab"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a092d0805a9e647c2048777dbe67b35ab">data_structures::trie_using_hashmap::Trie::Trie</a></div><div class="ttdeci">Trie()=default</div><div class="ttdoc">&lt; Constructor</div></div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_a7bbe538c8015e8ce158e7ed43f605ebd"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a7bbe538c8015e8ce158e7ed43f605ebd">data_structures::trie_using_hashmap::Trie::get_all_words</a></div><div class="ttdeci">std::vector&lt; std::string &gt; get_all_words(std::vector&lt; std::string &gt; results, const std::shared_ptr&lt; Node &gt; &amp;element, std::string prefix)</div><div class="ttdoc">helper function to predict/recommend words that starts with a given prefix from the end of prefix's n...</div><div class="ttdef"><b>Definition</b> <a href="#l00160">trie_using_hashmap.cpp:160</a></div></div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_a7bbe538c8015e8ce158e7ed43f605ebd"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a7bbe538c8015e8ce158e7ed43f605ebd">data_structures::trie_using_hashmap::Trie::get_all_words</a></div><div class="ttdeci">std::vector&lt; std::string &gt; get_all_words(std::vector&lt; std::string &gt; results, const std::shared_ptr&lt; Node &gt; &amp;element, std::string prefix)</div><div class="ttdoc">helper function to predict/recommend words that starts with a given prefix from the end of prefix&#39;s n...</div><div class="ttdef"><b>Definition</b> <a href="#l00160">trie_using_hashmap.cpp:160</a></div></div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_a832072498abeaa52ad43c4fc99cba248"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#a832072498abeaa52ad43c4fc99cba248">data_structures::trie_using_hashmap::Trie::root_node</a></div><div class="ttdeci">std::shared_ptr&lt; Node &gt; root_node</div><div class="ttdoc">declaring root node of trie</div><div class="ttdef"><b>Definition</b> <a href="#l00051">trie_using_hashmap.cpp:51</a></div></div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_abcae0a4456e7f583ce716e3ef466dfd2"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#abcae0a4456e7f583ce716e3ef466dfd2">data_structures::trie_using_hashmap::Trie::insert</a></div><div class="ttdeci">void insert(const std::string &amp;word)</div><div class="ttdoc">insert the string into the trie</div><div class="ttdef"><b>Definition</b> <a href="#l00062">trie_using_hashmap.cpp:62</a></div></div>
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_ac0bf3d6791cba144b3f539835d835e75"><div class="ttname"><a href="../../d3/d26/classdata__structures_1_1trie__using__hashmap_1_1_trie.html#ac0bf3d6791cba144b3f539835d835e75">data_structures::trie_using_hashmap::Trie::delete_word</a></div><div class="ttdeci">void delete_word(std::string word)</div><div class="ttdoc">delete a word/string from a trie</div><div class="ttdef"><b>Definition</b> <a href="#l00122">trie_using_hashmap.cpp:122</a></div></div>
@@ -438,7 +438,7 @@ $(function(){initNavTree('d5/d8a/trie__using__hashmap_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="../../d5/d8a/trie__using__hashmap_8cpp.html">trie_using_hashmap.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/least_common_multiple.cpp Pages: 1 -->
<svg width="170pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 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/least_common_multiple.cpp Pages: 1 -->
<svg width="170pt" height="83pt"

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 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');
@@ -135,7 +135,7 @@ $(function(){initNavTree('d9/df7/structothers_1_1recursive__tree__traversals_1_1
<!-- 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++: greedy_algorithms/huffman.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');
@@ -131,7 +131,7 @@ $(function(){initNavTree('d5/d8e/huffman_8cpp_source.html','../../'); initResiza
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// A Huffman tree node</span></div>
<div class="foldopen" id="foldopen00007" data-start="{" data-end="};">
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="../../d5/d29/struct_min_heap_node.html"> 7</a></span><span class="keyword">struct </span><a class="code hl_struct" href="../../d5/d29/struct_min_heap_node.html">MinHeapNode</a> {</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="../../d5/d29/struct_min_heap_node.html"> 7</a></span><span class="keyword">struct </span>MinHeapNode {</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// One of the input characters</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> <span class="keywordtype">char</span> data;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
@@ -139,13 +139,13 @@ $(function(){initNavTree('d5/d8e/huffman_8cpp_source.html','../../'); initResiza
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordtype">unsigned</span> freq;</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// Left and right child</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <a class="code hl_struct" href="../../d5/d29/struct_min_heap_node.html">MinHeapNode</a> *left, *right;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> MinHeapNode *left, *right;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <a class="code hl_struct" href="../../d5/d29/struct_min_heap_node.html">MinHeapNode</a>(<span class="keywordtype">char</span> <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>, <span class="keywordtype">unsigned</span> freq)</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> MinHeapNode(<span class="keywordtype">char</span> data, <span class="keywordtype">unsigned</span> freq)</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> {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> left = right = NULL;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> this-&gt;data = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> this-&gt;data = data;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> this-&gt;freq = freq;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span>};</div>
@@ -246,7 +246,7 @@ $(function(){initNavTree('d5/d8e/huffman_8cpp_source.html','../../'); initResiza
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><b>huffman.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++: dynamic_programming/palindrome_partitioning.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');
@@ -287,7 +287,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">
@@ -331,7 +331,7 @@ Functions</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d5/d90/palindrome__partitioning_8cpp.html">palindrome_partitioning.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 palindrome__partitioning_8cpp =
[
[ "main", "d5/d90/palindrome__partitioning_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "pal_part", "d5/d90/palindrome__partitioning_8cpp.html#a52ee22882858d2b1cf04293f02ed839a", null ],
[ "dynamic_programming::palindrome_partitioning::pal_part", "d5/d90/palindrome__partitioning_8cpp.html#a52ee22882858d2b1cf04293f02ed839a", null ],
[ "test", "d5/d90/palindrome__partitioning_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++: dynamic_programming/palindrome_partitioning.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,17 +124,18 @@ $(function(){initNavTree('d5/d90/palindrome__partitioning_8cpp_source.html','../
<div class="headertitle"><div class="title">palindrome_partitioning.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d90/palindrome__partitioning_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="../../d5/d90/palindrome__partitioning_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="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="preprocessor">#include &lt;algorithm&gt;</span> <span class="comment">// for std::min</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include &lt;cassert&gt;</span> <span class="comment">// for std::assert</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &lt;climits&gt;</span> <span class="comment">// for INT_MAX</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;iostream&gt;</span> <span class="comment">// for io operations</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include &lt;vector&gt;</span> <span class="comment">// for std::vector</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a> {</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="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d89/namespacepalindrome__partitioning.html">palindrome_partitioning</a> {</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="foldopen" id="foldopen00045" data-start="{" data-end="}">
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="../../d5/d90/palindrome__partitioning_8cpp.html#a52ee22882858d2b1cf04293f02ed839a"> 45</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d90/palindrome__partitioning_8cpp.html#a52ee22882858d2b1cf04293f02ed839a">pal_part</a>(<span class="keyword">const</span> std::string &amp;str) {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">int</span> n = str.size();</div>
@@ -185,7 +186,7 @@ $(function(){initNavTree('d5/d90/palindrome__partitioning_8cpp_source.html','../
</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span>} <span class="comment">// namespace palindrome_partitioning</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span>} <span class="comment">// namespace dynamic_programming</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span></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="../../d5/d90/palindrome__partitioning_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 98</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d90/palindrome__partitioning_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// custom input vector</span></div>
@@ -196,7 +197,7 @@ $(function(){initNavTree('d5/d90/palindrome__partitioning_8cpp_source.html','../
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3; i++) {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> calculated_output[i] =</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> dynamic_programming::palindrome_partitioning::pal_part(</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <a class="code hl_function" href="../../d5/d90/palindrome__partitioning_8cpp.html#a52ee22882858d2b1cf04293f02ed839a">dynamic_programming::palindrome_partitioning::pal_part</a>(</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> custom_input[i]);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
@@ -213,7 +214,7 @@ $(function(){initNavTree('d5/d90/palindrome__partitioning_8cpp_source.html','../
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::cout &lt;&lt; <span class="stringliteral">&quot;All tests passed successfully!\n&quot;</span>;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span>}</div>
</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span></div>
<div class="foldopen" id="foldopen00128" data-start="{" data-end="}">
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="../../d5/d90/palindrome__partitioning_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 128</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d90/palindrome__partitioning_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_function" href="../../d5/d90/palindrome__partitioning_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the test</span></div>
@@ -231,7 +232,7 @@ $(function(){initNavTree('d5/d90/palindrome__partitioning_8cpp_source.html','../
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_8a20dd5bfd5341a725342bf72b6b686f.html">dynamic_programming</a></li><li class="navelem"><a class="el" href="../../d5/d90/palindrome__partitioning_8cpp.html">palindrome_partitioning.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++: sorting 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');
@@ -132,57 +132,57 @@ $(function(){initNavTree('d5/d91/namespacesorting.html','../../'); initResizable
<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:a034d8b276518a902962e87d3158b64fd" id="r_a034d8b276518a902962e87d3158b64fd"><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr class="memitem:a034d8b276518a902962e87d3158b64fd" id="r_a034d8b276518a902962e87d3158b64fd"><td class="memTemplParams" colspan="2">template&lt;class T&gt; </td></tr>
<tr class="memitem:a034d8b276518a902962e87d3158b64fd"><td class="memTemplItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a034d8b276518a902962e87d3158b64fd">binary_search</a> (std::vector&lt; T &gt; &amp;arr, T val, int64_t low, int64_t high)</td></tr>
<tr class="memdesc:a034d8b276518a902962e87d3158b64fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Binary search function to find the most suitable pace for an element. <br /></td></tr>
<tr class="separator:a034d8b276518a902962e87d3158b64fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f4bc75cca6dd8294af2d0e328006c68" id="r_a5f4bc75cca6dd8294af2d0e328006c68"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5f4bc75cca6dd8294af2d0e328006c68" id="r_a5f4bc75cca6dd8294af2d0e328006c68"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a5f4bc75cca6dd8294af2d0e328006c68"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a5f4bc75cca6dd8294af2d0e328006c68">insertionSort_binsrch</a> (std::vector&lt; T &gt; &amp;arr)</td></tr>
<tr class="memdesc:a5f4bc75cca6dd8294af2d0e328006c68"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insertion sort function to sort the vector. <br /></td></tr>
<tr class="separator:a5f4bc75cca6dd8294af2d0e328006c68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7bfe11bd4703eacd1dab93f25ec639c5" id="r_a7bfe11bd4703eacd1dab93f25ec639c5"><td class="memTemplParams" colspan="2">template&lt;typename T , size_t N&gt; </td></tr>
<tr class="memitem:a7bfe11bd4703eacd1dab93f25ec639c5" id="r_a7bfe11bd4703eacd1dab93f25ec639c5"><td class="memTemplParams" colspan="2">template&lt;typename T, size_t N&gt; </td></tr>
<tr class="memitem:a7bfe11bd4703eacd1dab93f25ec639c5"><td class="memTemplItemLeft" align="right" valign="top">std::array&lt; T, N &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a7bfe11bd4703eacd1dab93f25ec639c5">shuffle</a> (std::array&lt; T, N &gt; arr)</td></tr>
<tr class="separator:a7bfe11bd4703eacd1dab93f25ec639c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affc6ee160142cd017f8c4b213437d0fd" id="r_affc6ee160142cd017f8c4b213437d0fd"><td class="memTemplParams" colspan="2">template&lt;typename T , size_t N&gt; </td></tr>
<tr class="memitem:affc6ee160142cd017f8c4b213437d0fd" id="r_affc6ee160142cd017f8c4b213437d0fd"><td class="memTemplParams" colspan="2">template&lt;typename T, size_t N&gt; </td></tr>
<tr class="memitem:affc6ee160142cd017f8c4b213437d0fd"><td class="memTemplItemLeft" align="right" valign="top">std::array&lt; T, N &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#affc6ee160142cd017f8c4b213437d0fd">randomized_bogosort</a> (std::array&lt; T, N &gt; arr)</td></tr>
<tr class="separator:affc6ee160142cd017f8c4b213437d0fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f8bc626eb57acae24a94636a23af6a1" id="r_a2f8bc626eb57acae24a94636a23af6a1"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a2f8bc626eb57acae24a94636a23af6a1" id="r_a2f8bc626eb57acae24a94636a23af6a1"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a2f8bc626eb57acae24a94636a23af6a1"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a2f8bc626eb57acae24a94636a23af6a1">gnomeSort</a> (T *arr, int size)</td></tr>
<tr class="separator:a2f8bc626eb57acae24a94636a23af6a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3677f87b5b4756bc77e9e34c5f27935" id="r_aa3677f87b5b4756bc77e9e34c5f27935"><td class="memTemplParams" colspan="2">template&lt;typename T , size_t size&gt; </td></tr>
<tr class="memitem:aa3677f87b5b4756bc77e9e34c5f27935" id="r_aa3677f87b5b4756bc77e9e34c5f27935"><td class="memTemplParams" colspan="2">template&lt;typename T, size_t size&gt; </td></tr>
<tr class="memitem:aa3677f87b5b4756bc77e9e34c5f27935"><td class="memTemplItemLeft" align="right" valign="top">std::array&lt; T, size &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa3677f87b5b4756bc77e9e34c5f27935">gnomeSort</a> (std::array&lt; T, size &gt; arr)</td></tr>
<tr class="separator:aa3677f87b5b4756bc77e9e34c5f27935"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78cb2f3b97b6db2c062b2a1df05c9ea9" id="r_a78cb2f3b97b6db2c062b2a1df05c9ea9"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a78cb2f3b97b6db2c062b2a1df05c9ea9" id="r_a78cb2f3b97b6db2c062b2a1df05c9ea9"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a78cb2f3b97b6db2c062b2a1df05c9ea9"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a78cb2f3b97b6db2c062b2a1df05c9ea9">insertionSort</a> (T *arr, int n)</td></tr>
<tr class="memdesc:a78cb2f3b97b6db2c062b2a1df05c9ea9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insertion Sort Function. <br /></td></tr>
<tr class="separator:a78cb2f3b97b6db2c062b2a1df05c9ea9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fe6bac9e03f58abcc2ce26ef3de1b5f" id="r_a8fe6bac9e03f58abcc2ce26ef3de1b5f"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a8fe6bac9e03f58abcc2ce26ef3de1b5f" id="r_a8fe6bac9e03f58abcc2ce26ef3de1b5f"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a8fe6bac9e03f58abcc2ce26ef3de1b5f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8fe6bac9e03f58abcc2ce26ef3de1b5f">insertionSort</a> (std::vector&lt; T &gt; *arr)</td></tr>
<tr class="memdesc:a8fe6bac9e03f58abcc2ce26ef3de1b5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insertion Sort for a vector. <br /></td></tr>
<tr class="separator:a8fe6bac9e03f58abcc2ce26ef3de1b5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa26de383227859210f14dcf12201a079" id="r_aa26de383227859210f14dcf12201a079"><td class="memTemplParams" colspan="2">template&lt;class Iterator &gt; </td></tr>
<tr class="memitem:aa26de383227859210f14dcf12201a079" id="r_aa26de383227859210f14dcf12201a079"><td class="memTemplParams" colspan="2">template&lt;class Iterator&gt; </td></tr>
<tr class="memitem:aa26de383227859210f14dcf12201a079"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa26de383227859210f14dcf12201a079">merge</a> (Iterator l, Iterator r, const Iterator e, char b[])</td></tr>
<tr class="memdesc:aa26de383227859210f14dcf12201a079"><td class="mdescLeft">&#160;</td><td class="mdescRight">merges 2 sorted adjacent segments into a larger sorted segment <br /></td></tr>
<tr class="separator:aa26de383227859210f14dcf12201a079"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a140d913e42fb94176a0b2c8b29a80420" id="r_a140d913e42fb94176a0b2c8b29a80420"><td class="memTemplParams" colspan="2">template&lt;class Iterator &gt; </td></tr>
<tr class="memitem:a140d913e42fb94176a0b2c8b29a80420" id="r_a140d913e42fb94176a0b2c8b29a80420"><td class="memTemplParams" colspan="2">template&lt;class Iterator&gt; </td></tr>
<tr class="memitem:a140d913e42fb94176a0b2c8b29a80420"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a140d913e42fb94176a0b2c8b29a80420">non_recursive_merge_sort</a> (const Iterator first, const Iterator last, const size_t n)</td></tr>
<tr class="memdesc:a140d913e42fb94176a0b2c8b29a80420"><td class="mdescLeft">&#160;</td><td class="mdescRight">bottom-up merge sort which sorts elements in a non-decreasing order <br /></td></tr>
<tr class="separator:a140d913e42fb94176a0b2c8b29a80420"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27236b8d3df3832e1f1225576a122534" id="r_a27236b8d3df3832e1f1225576a122534"><td class="memTemplParams" colspan="2">template&lt;class Iterator &gt; </td></tr>
<tr class="memitem:a27236b8d3df3832e1f1225576a122534" id="r_a27236b8d3df3832e1f1225576a122534"><td class="memTemplParams" colspan="2">template&lt;class Iterator&gt; </td></tr>
<tr class="memitem:a27236b8d3df3832e1f1225576a122534"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a27236b8d3df3832e1f1225576a122534">non_recursive_merge_sort</a> (const Iterator first, const size_t n)</td></tr>
<tr class="memdesc:a27236b8d3df3832e1f1225576a122534"><td class="mdescLeft">&#160;</td><td class="mdescRight">bottom-up merge sort which sorts elements in a non-decreasing order <br /></td></tr>
<tr class="separator:a27236b8d3df3832e1f1225576a122534"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae97f4dd815654c4682f564afd718e824" id="r_ae97f4dd815654c4682f564afd718e824"><td class="memTemplParams" colspan="2">template&lt;class Iterator &gt; </td></tr>
<tr class="memitem:ae97f4dd815654c4682f564afd718e824" id="r_ae97f4dd815654c4682f564afd718e824"><td class="memTemplParams" colspan="2">template&lt;class Iterator&gt; </td></tr>
<tr class="memitem:ae97f4dd815654c4682f564afd718e824"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ae97f4dd815654c4682f564afd718e824">non_recursive_merge_sort</a> (const Iterator first, const Iterator last)</td></tr>
<tr class="memdesc:ae97f4dd815654c4682f564afd718e824"><td class="mdescLeft">&#160;</td><td class="mdescRight">bottom-up merge sort which sorts elements in a non-decreasing order <br /></td></tr>
<tr class="separator:ae97f4dd815654c4682f564afd718e824"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e9e1b21a1684585e9e50f9afe4d53a3" id="r_a0e9e1b21a1684585e9e50f9afe4d53a3"><td class="memTemplParams" colspan="2">template&lt;std::size_t N&gt; </td></tr>
<tr class="memitem:a0e9e1b21a1684585e9e50f9afe4d53a3"><td class="memTemplItemLeft" align="right" valign="top">std::array&lt; int, N &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a0e9e1b21a1684585e9e50f9afe4d53a3">pigeonSort</a> (std::array&lt; int, N &gt; arr)</td></tr>
<tr class="separator:a0e9e1b21a1684585e9e50f9afe4d53a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f59fe72dacc1f1218ef3c303d843168" id="r_a9f59fe72dacc1f1218ef3c303d843168"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a9f59fe72dacc1f1218ef3c303d843168" id="r_a9f59fe72dacc1f1218ef3c303d843168"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a9f59fe72dacc1f1218ef3c303d843168"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a> (std::vector&lt; T &gt; *arr, int32_t low, int32_t high)</td></tr>
<tr class="separator:a9f59fe72dacc1f1218ef3c303d843168"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6eb67c2f91c98cf4464f75b5882022de" id="r_a6eb67c2f91c98cf4464f75b5882022de"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a6eb67c2f91c98cf4464f75b5882022de" id="r_a6eb67c2f91c98cf4464f75b5882022de"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a6eb67c2f91c98cf4464f75b5882022de"><td class="memTemplItemLeft" align="right" valign="top">std::vector&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a6eb67c2f91c98cf4464f75b5882022de">quicksort</a> (std::vector&lt; T &gt; arr, int32_t low, int32_t high)</td></tr>
<tr class="separator:a6eb67c2f91c98cf4464f75b5882022de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac8f44b28b4aa96444383030b28f8b34" id="r_aac8f44b28b4aa96444383030b28f8b34"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aac8f44b28b4aa96444383030b28f8b34">partition</a> (std::vector&lt; int &gt; &amp;arr, int start, int end)</td></tr>
@@ -191,19 +191,19 @@ Functions</h2></td></tr>
<tr class="memitem:a263595fd9a0163b5b997b89fab3a0dc5" id="r_a263595fd9a0163b5b997b89fab3a0dc5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a263595fd9a0163b5b997b89fab3a0dc5">iterativeQuickSort</a> (std::vector&lt; int &gt; &amp;arr)</td></tr>
<tr class="memdesc:a263595fd9a0163b5b997b89fab3a0dc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The main sorting function. <br /></td></tr>
<tr class="separator:a263595fd9a0163b5b997b89fab3a0dc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3a775d99dbbb94c130a973df0cfddcf" id="r_ae3a775d99dbbb94c130a973df0cfddcf"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ae3a775d99dbbb94c130a973df0cfddcf" id="r_ae3a775d99dbbb94c130a973df0cfddcf"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:ae3a775d99dbbb94c130a973df0cfddcf"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ae3a775d99dbbb94c130a973df0cfddcf">recursive_bubble_sort</a> (std::vector&lt; T &gt; *nums, uint64_t n)</td></tr>
<tr class="memdesc:ae3a775d99dbbb94c130a973df0cfddcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an implementation of the recursive_bubble_sort. A vector is passed to the function which is then dereferenced, so that the changes are reflected in the original vector. It also accepts a second parameter of type <code>int</code> and name <code>n</code>, which is the size of the array. <br /></td></tr>
<tr class="separator:ae3a775d99dbbb94c130a973df0cfddcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06af4f0dae2de2a2ae5b797d7aa26755" id="r_a06af4f0dae2de2a2ae5b797d7aa26755"><td class="memItemLeft" align="right" valign="top">std::vector&lt; uint64_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a06af4f0dae2de2a2ae5b797d7aa26755">selectionSort</a> (const std::vector&lt; uint64_t &gt; &amp;arr, uint64_t len)</td></tr>
<tr class="separator:a06af4f0dae2de2a2ae5b797d7aa26755"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa" id="r_a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa" id="r_a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a5669396c6a6b1e14b97589b6e37980aa"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a> (T *arr, size_t LEN)</td></tr>
<tr class="separator:a5669396c6a6b1e14b97589b6e37980aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d76603c54d3dc56146e92d10a043924" id="r_a4d76603c54d3dc56146e92d10a043924"><td class="memTemplParams" colspan="2">template&lt;typename T , size_t N&gt; </td></tr>
<tr class="memitem:a4d76603c54d3dc56146e92d10a043924" id="r_a4d76603c54d3dc56146e92d10a043924"><td class="memTemplParams" colspan="2">template&lt;typename T, size_t N&gt; </td></tr>
<tr class="memitem:a4d76603c54d3dc56146e92d10a043924"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a4d76603c54d3dc56146e92d10a043924">shell_sort</a> (T(&amp;arr)[N])</td></tr>
<tr class="separator:a4d76603c54d3dc56146e92d10a043924"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2c5b92cbfe73f63f6074c61b0a45331" id="r_af2c5b92cbfe73f63f6074c61b0a45331"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:af2c5b92cbfe73f63f6074c61b0a45331" id="r_af2c5b92cbfe73f63f6074c61b0a45331"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:af2c5b92cbfe73f63f6074c61b0a45331"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#af2c5b92cbfe73f63f6074c61b0a45331">shell_sort</a> (std::vector&lt; T &gt; *arr)</td></tr>
<tr class="separator:af2c5b92cbfe73f63f6074c61b0a45331"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
@@ -251,7 +251,7 @@ Functions</h2></td></tr>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
template&lt;class T&gt; </div>
<table class="memname">
<tr>
<td class="memname">int64_t sorting::binary_search </td>
@@ -301,7 +301,7 @@ template&lt;class T &gt; </div>
<div class="line"><span class="lineno"> 66</span> }</div>
<div class="line"><span class="lineno"> 67</span> int64_t mid = low + (high - low) / 2;</div>
<div class="line"><span class="lineno"> 68</span> <span class="keywordflow">if</span> (arr[mid] &gt; val) {</div>
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">return</span> binary_search(arr, val, low, mid - 1);</div>
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a034d8b276518a902962e87d3158b64fd">binary_search</a>(arr, val, low, mid - 1);</div>
<div class="line"><span class="lineno"> 70</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (arr[mid] &lt; val) {</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a034d8b276518a902962e87d3158b64fd">binary_search</a>(arr, val, mid + 1, high);</div>
<div class="line"><span class="lineno"> 72</span> } <span class="keywordflow">else</span> {</div>
@@ -318,7 +318,7 @@ template&lt;class T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , size_t size&gt; </div>
template&lt;typename T, size_t size&gt; </div>
<table class="memname">
<tr>
<td class="memname">std::array&lt; T, size &gt; sorting::gnomeSort </td>
@@ -371,7 +371,7 @@ template&lt;typename T , size_t size&gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::gnomeSort </td>
@@ -420,7 +420,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::insertionSort </td>
@@ -481,7 +481,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::insertionSort </td>
@@ -545,7 +545,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::insertionSort_binsrch </td>
@@ -615,7 +615,7 @@ template&lt;typename T &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d3/d22/quick__sort__iterative_8cpp_source.html#l00058">58</a> of file <a class="el" href="../../d3/d22/quick__sort__iterative_8cpp_source.html">quick_sort_iterative.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 59</span>{</div>
<div class="line"><span class="lineno"> 60</span> std::stack&lt;int&gt; <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>;</div>
<div class="line"><span class="lineno"> 60</span> std::stack&lt;int&gt; <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>;</div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordtype">int</span> start = 0;</div>
<div class="line"><span class="lineno"> 62</span> <span class="keywordtype">int</span> end = arr.size()-1;</div>
<div class="line"><span class="lineno"> 63</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(start);</div>
@@ -628,7 +628,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 70</span> start = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
<div class="line"><span class="lineno"> 71</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
<div class="line"><span class="lineno"> 72</span> </div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordtype">int</span> pivotIndex = partition(arr,start,end);</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordtype">int</span> pivotIndex = <a class="code hl_function" href="#aac8f44b28b4aa96444383030b28f8b34">partition</a>(arr,start,end);</div>
<div class="line"><span class="lineno"> 74</span> </div>
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">if</span>(pivotIndex -1 &gt; start)</div>
<div class="line"><span class="lineno"> 76</span> {</div>
@@ -647,7 +647,7 @@ template&lt;typename T &gt; </div>
<div class="ttc" id="aclassstack_html_a3647fb4418890f19e0dc414b8092b8b0"><div class="ttname"><a href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">stack::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00062">stack.hpp:62</a></div></div>
<div class="ttc" id="aclassstack_html_a90df277532c23519aa7ac3c08ed90a1d"><div class="ttname"><a href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">stack::push</a></div><div class="ttdeci">void push(const value_type &amp;item)</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00047">stack.hpp:47</a></div></div>
<div class="ttc" id="aclassstack_html_ae09630c4384903d187801921b2ddc709"><div class="ttname"><a href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">stack::top</a></div><div class="ttdeci">value_type top() const</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00056">stack.hpp:56</a></div></div>
<div class="ttc" id="aparanthesis__matching_8cpp_html_aa37d24a036d239b3b528f13b9de880c7"><div class="ttname"><a href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a></div><div class="ttdeci">char stack[MAX]</div><div class="ttdef"><b>Definition</b> <a href="../../dc/dc5/paranthesis__matching_8cpp_source.html#l00020">paranthesis_matching.cpp:20</a></div></div>
<div class="ttc" id="anamespacesorting_html_aac8f44b28b4aa96444383030b28f8b34"><div class="ttname"><a href="#aac8f44b28b4aa96444383030b28f8b34">sorting::partition</a></div><div class="ttdeci">int partition(std::vector&lt; int &gt; &amp;arr, int start, int end)</div><div class="ttdoc">The partition function sorts the array from start to end and uses the last element as the pivot.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d22/quick__sort__iterative_8cpp_source.html#l00033">quick_sort_iterative.cpp:33</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -657,7 +657,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Iterator &gt; </div>
template&lt;class Iterator&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::merge </td>
@@ -717,7 +717,7 @@ template&lt;class Iterator &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Iterator &gt; </div>
template&lt;class Iterator&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::non_recursive_merge_sort </td>
@@ -743,8 +743,9 @@ template&lt;class Iterator &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d0/db6/non__recursive__merge__sort_8cpp_source.html#l00086">86</a> of file <a class="el" href="../../d0/db6/non__recursive__merge__sort_8cpp_source.html">non_recursive_merge_sort.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 86</span> {</div>
<div class="line"><span class="lineno"> 87</span> non_recursive_merge_sort(first, last, last - first);</div>
<div class="line"><span class="lineno"> 87</span> <a class="code hl_function" href="#a140d913e42fb94176a0b2c8b29a80420">non_recursive_merge_sort</a>(first, last, last - first);</div>
<div class="line"><span class="lineno"> 88</span>}</div>
<div class="ttc" id="anamespacesorting_html_a140d913e42fb94176a0b2c8b29a80420"><div class="ttname"><a href="#a140d913e42fb94176a0b2c8b29a80420">sorting::non_recursive_merge_sort</a></div><div class="ttdeci">void non_recursive_merge_sort(const Iterator first, const Iterator last, const size_t n)</div><div class="ttdoc">bottom-up merge sort which sorts elements in a non-decreasing order</div><div class="ttdef"><b>Definition</b> <a href="../../d0/db6/non__recursive__merge__sort_8cpp_source.html#l00025">non_recursive_merge_sort.cpp:25</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -754,7 +755,7 @@ template&lt;class Iterator &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Iterator &gt; </div>
template&lt;class Iterator&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::non_recursive_merge_sort </td>
@@ -797,17 +798,17 @@ template&lt;class Iterator &gt; </div>
<div class="line"><span class="lineno"> 35</span> Iterator left(first);</div>
<div class="line"><span class="lineno"> 36</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> counter(n / (length &lt;&lt; 1)); counter; --counter) {</div>
<div class="line"><span class="lineno"> 37</span> Iterator right(left + length), end(right + length);</div>
<div class="line"><span class="lineno"> 38</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a>(left, right, end, buffer);</div>
<div class="line"><span class="lineno"> 38</span> <a class="code hl_function" href="#aa26de383227859210f14dcf12201a079">merge</a>(left, right, end, buffer);</div>
<div class="line"><span class="lineno"> 39</span> left = end;</div>
<div class="line"><span class="lineno"> 40</span> }</div>
<div class="line"><span class="lineno"> 41</span> <span class="comment">// if the number of remaining elements (n * 2 % length) is longer</span></div>
<div class="line"><span class="lineno"> 42</span> <span class="comment">// than a segment, merge the remaining elements</span></div>
<div class="line"><span class="lineno"> 43</span> <span class="keywordflow">if</span> ((n &amp; ((length &lt;&lt; 1) - 1)) &gt; length)</div>
<div class="line"><span class="lineno"> 44</span> <a class="code hl_function" href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a>(left, left + length, last, buffer);</div>
<div class="line"><span class="lineno"> 44</span> <a class="code hl_function" href="#aa26de383227859210f14dcf12201a079">merge</a>(left, left + length, last, buffer);</div>
<div class="line"><span class="lineno"> 45</span> }</div>
<div class="line"><span class="lineno"> 46</span> <span class="keyword">delete</span>[] buffer;</div>
<div class="line"><span class="lineno"> 47</span>}</div>
<div class="ttc" id="agroup__sorting_html_ga460c61cd948203b4816bef2accb3fc73"><div class="ttname"><a href="../../d5/d4c/group__sorting.html#ga460c61cd948203b4816bef2accb3fc73">merge</a></div><div class="ttdeci">void merge(int *arr, int l, int m, int r)</div><div class="ttdef"><b>Definition</b> <a href="../../d5/df4/merge__sort_8cpp_source.html#l00033">merge_sort.cpp:33</a></div></div>
<div class="ttc" id="anamespacesorting_html_aa26de383227859210f14dcf12201a079"><div class="ttname"><a href="#aa26de383227859210f14dcf12201a079">sorting::merge</a></div><div class="ttdeci">void merge(Iterator, Iterator, const Iterator, char[])</div><div class="ttdoc">merges 2 sorted adjacent segments into a larger sorted segment</div><div class="ttdef"><b>Definition</b> <a href="../../d0/db6/non__recursive__merge__sort_8cpp_source.html#l00057">non_recursive_merge_sort.cpp:57</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -817,7 +818,7 @@ template&lt;class Iterator &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Iterator &gt; </div>
template&lt;class Iterator&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::non_recursive_merge_sort </td>
@@ -843,7 +844,7 @@ template&lt;class Iterator &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d0/db6/non__recursive__merge__sort_8cpp_source.html#l00077">77</a> of file <a class="el" href="../../d0/db6/non__recursive__merge__sort_8cpp_source.html">non_recursive_merge_sort.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 77</span> {</div>
<div class="line"><span class="lineno"> 78</span> non_recursive_merge_sort(first, first + n, n);</div>
<div class="line"><span class="lineno"> 78</span> <a class="code hl_function" href="#a140d913e42fb94176a0b2c8b29a80420">non_recursive_merge_sort</a>(first, first + n, n);</div>
<div class="line"><span class="lineno"> 79</span>}</div>
</div><!-- fragment -->
</div>
@@ -961,7 +962,7 @@ template&lt;std::size_t N&gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::quicksort </td>
@@ -1007,9 +1008,10 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 102</span> partition3(arr, low, high, &amp;i, &amp;j);</div>
<div class="line"><span class="lineno"> 103</span> </div>
<div class="line"><span class="lineno"> 104</span> <span class="comment">// Recur two halves</span></div>
<div class="line"><span class="lineno"> 105</span> quicksort(arr, low, i);</div>
<div class="line"><span class="lineno"> 106</span> quicksort(arr, j, high);</div>
<div class="line"><span class="lineno"> 105</span> <a class="code hl_function" href="#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(arr, low, i);</div>
<div class="line"><span class="lineno"> 106</span> <a class="code hl_function" href="#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(arr, j, high);</div>
<div class="line"><span class="lineno"> 107</span>}</div>
<div class="ttc" id="anamespacesorting_html_a9f59fe72dacc1f1218ef3c303d843168"><div class="ttname"><a href="#a9f59fe72dacc1f1218ef3c303d843168">sorting::quicksort</a></div><div class="ttdeci">void quicksort(std::vector&lt; T &gt; *arr, int32_t low, int32_t high)</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d4c/quick__sort__3_8cpp_source.html#l00094">quick_sort_3.cpp:94</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -1019,7 +1021,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">std::vector&lt; T &gt; sorting::quicksort </td>
@@ -1066,8 +1068,8 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 127</span> partition3(&amp;arr, low, high, &amp;i, &amp;j);</div>
<div class="line"><span class="lineno"> 128</span> </div>
<div class="line"><span class="lineno"> 129</span> <span class="comment">// Recur two halves</span></div>
<div class="line"><span class="lineno"> 130</span> quicksort(&amp;arr, low, i);</div>
<div class="line"><span class="lineno"> 131</span> quicksort(&amp;arr, j, high);</div>
<div class="line"><span class="lineno"> 130</span> <a class="code hl_function" href="#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(&amp;arr, low, i);</div>
<div class="line"><span class="lineno"> 131</span> <a class="code hl_function" href="#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(&amp;arr, j, high);</div>
<div class="line"><span class="lineno"> 132</span> </div>
<div class="line"><span class="lineno"> 133</span> <span class="keywordflow">return</span> arr;</div>
<div class="line"><span class="lineno"> 134</span>}</div>
@@ -1080,7 +1082,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , size_t N&gt; </div>
template&lt;typename T, size_t N&gt; </div>
<table class="memname">
<tr>
<td class="memname">std::array&lt; T, N &gt; sorting::randomized_bogosort </td>
@@ -1124,7 +1126,7 @@ template&lt;typename T , size_t N&gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::recursive_bubble_sort </td>
@@ -1168,7 +1170,7 @@ template&lt;typename T &gt; </div>
<div class="line"><span class="lineno"> 92</span> std::swap((*nums)[i], (*nums)[i + 1]);</div>
<div class="line"><span class="lineno"> 93</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"> 95</span></div>
<div class="line"><span class="lineno"> 97</span> <a class="code hl_function" href="#ae3a775d99dbbb94c130a973df0cfddcf">recursive_bubble_sort</a>(nums, n - 1);</div>
<div class="line"><span class="lineno"> 98</span>}</div>
<div class="ttc" id="anamespacesorting_html_ae3a775d99dbbb94c130a973df0cfddcf"><div class="ttname"><a href="#ae3a775d99dbbb94c130a973df0cfddcf">sorting::recursive_bubble_sort</a></div><div class="ttdeci">void recursive_bubble_sort(std::vector&lt; T &gt; *nums, uint64_t n)</div><div class="ttdoc">This is an implementation of the recursive_bubble_sort. A vector is passed to the function which is t...</div><div class="ttdef"><b>Definition</b> <a href="../../d3/df9/recursive__bubble__sort_8cpp_source.html#l00084">recursive_bubble_sort.cpp:84</a></div></div>
@@ -1225,7 +1227,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::shell_sort </td>
@@ -1239,8 +1241,9 @@ template&lt;typename T &gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d4/d7a/shell__sort2_8cpp_source.html#l00075">75</a> of file <a class="el" href="../../d4/d7a/shell__sort2_8cpp_source.html">shell_sort2.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 75</span> {</div>
<div class="line"><span class="lineno"> 76</span> shell_sort(arr-&gt;data(), arr-&gt;size());</div>
<div class="line"><span class="lineno"> 76</span> <a class="code hl_function" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(arr-&gt;data(), arr-&gt;size());</div>
<div class="line"><span class="lineno"> 77</span>}</div>
<div class="ttc" id="anamespacesorting_html_a5669396c6a6b1e14b97589b6e37980aa"><div class="ttname"><a href="#a5669396c6a6b1e14b97589b6e37980aa">sorting::shell_sort</a></div><div class="ttdeci">void shell_sort(T *arr, size_t LEN)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d7a/shell__sort2_8cpp_source.html#l00045">shell_sort2.cpp:45</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -1250,7 +1253,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::shell_sort </td>
@@ -1294,7 +1297,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , size_t N&gt; </div>
template&lt;typename T, size_t N&gt; </div>
<table class="memname">
<tr>
<td class="memname">void sorting::shell_sort </td>
@@ -1308,7 +1311,7 @@ template&lt;typename T , size_t N&gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d4/d7a/shell__sort2_8cpp_source.html#l00067">67</a> of file <a class="el" href="../../d4/d7a/shell__sort2_8cpp_source.html">shell_sort2.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 67</span> {</div>
<div class="line"><span class="lineno"> 68</span> shell_sort(arr, N);</div>
<div class="line"><span class="lineno"> 68</span> <a class="code hl_function" href="#a5669396c6a6b1e14b97589b6e37980aa">shell_sort</a>(arr, N);</div>
<div class="line"><span class="lineno"> 69</span>}</div>
</div><!-- fragment -->
</div>
@@ -1319,7 +1322,7 @@ template&lt;typename T , size_t N&gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , size_t N&gt; </div>
template&lt;typename T, size_t N&gt; </div>
<table class="memname">
<tr>
<td class="memname">std::array&lt; T, N &gt; sorting::shuffle </td>
@@ -1361,7 +1364,7 @@ template&lt;typename T , size_t N&gt; </div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d91/namespacesorting.html">sorting</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/binary_addition.cpp Pages: 1 -->
<svg width="260pt" 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: greedy_algorithms/binary_addition.cpp Pages: 1 -->
<svg width="260pt" 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: math/n_bonacci.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: math/n_bonacci.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++: data_structures::treap::Treap 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');
@@ -225,7 +225,7 @@ Public 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">
@@ -266,7 +266,7 @@ Public 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">
@@ -333,7 +333,7 @@ Public 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">
@@ -386,7 +386,7 @@ Public 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">
@@ -440,7 +440,7 @@ Public 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">
@@ -499,7 +499,7 @@ Public 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">
@@ -536,7 +536,7 @@ Public 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">
@@ -573,7 +573,7 @@ Public 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">
@@ -620,7 +620,7 @@ Public 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">
@@ -667,7 +667,7 @@ Public 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">
@@ -704,7 +704,7 @@ Public 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">
@@ -744,7 +744,7 @@ Public 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">
@@ -789,7 +789,7 @@ Public 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">
@@ -954,7 +954,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><a class="el" href="../../dd/d2e/namespacedata__structures_1_1treap.html">treap</a></li><li class="navelem"><a class="el" href="../../d5/d95/structdata__structures_1_1treap_1_1_treap.html">Treap</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++: hashing/md5.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');
@@ -283,7 +283,7 @@ Algorithm</h3>
<div class="line"><span class="lineno"> 148</span> 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};</div>
<div class="line"><span class="lineno"> 149</span> <span class="comment">// K is pseudo-random values used each round</span></div>
<div class="line"><span class="lineno"> 150</span> <span class="comment">// The values can be obtained by the following python code:</span></div>
<div class="line"><span class="lineno"> 151</span> </div>
<div class="line"><span class="lineno"> 151</span></div>
<div class="line"><span class="lineno"> 162</span> std::array&lt;uint32_t, 64&gt; K = {</div>
<div class="line"><span class="lineno"> 163</span> 3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426,</div>
<div class="line"><span class="lineno"> 164</span> 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134,</div>
@@ -430,7 +430,7 @@ Algorithm</h3>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -621,7 +621,7 @@ false IF integers are detected to work as little-endian </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">
@@ -637,7 +637,7 @@ false IF integers are detected to work as little-endian </dd></dl>
<div class="line"><span class="lineno"> 302</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><span class="lineno"> 303</span> std::cout &lt;&lt; <a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 304</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><span class="lineno"> 305</span> assert(hashing::md5::sig2hex(sig).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 305</span> assert(<a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 306</span> <span class="stringliteral">&quot;d41d8cd98f00b204e9800998ecf8427e&quot;</span>) == 0);</div>
<div class="line"><span class="lineno"> 307</span> </div>
<div class="line"><span class="lineno"> 308</span> <span class="comment">// Hashes &quot;The quick brown fox jumps over the lazy dog&quot; and stores signature</span></div>
@@ -648,7 +648,7 @@ false IF integers are detected to work as little-endian </dd></dl>
<div class="line"><span class="lineno"> 313</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><span class="lineno"> 314</span> std::cout &lt;&lt; <a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig2) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 315</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><span class="lineno"> 316</span> assert(hashing::md5::sig2hex(sig2).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 316</span> assert(<a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig2).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 317</span> <span class="stringliteral">&quot;9e107d9d372bb6826bd81d3542a419d6&quot;</span>) == 0);</div>
<div class="line"><span class="lineno"> 318</span> </div>
<div class="line"><span class="lineno"> 319</span> <span class="comment">// Hashes &quot;The quick brown fox jumps over the lazy dog.&quot; (notice the</span></div>
@@ -661,7 +661,7 @@ false IF integers are detected to work as little-endian </dd></dl>
<div class="line"><span class="lineno"> 326</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><span class="lineno"> 327</span> std::cout &lt;&lt; <a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig3) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 328</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><span class="lineno"> 329</span> assert(hashing::md5::sig2hex(sig3).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 329</span> assert(<a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig3).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 330</span> <span class="stringliteral">&quot;e4d909c290d0fb1ca068ffaddf22cbd0&quot;</span>) == 0);</div>
<div class="line"><span class="lineno"> 331</span> </div>
<div class="line"><span class="lineno"> 332</span> <span class="comment">// Hashes &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&quot;</span></div>
@@ -675,7 +675,7 @@ false IF integers are detected to work as little-endian </dd></dl>
<div class="line"><span class="lineno"> 340</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><span class="lineno"> 341</span> std::cout &lt;&lt; <a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig4) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 342</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><span class="lineno"> 343</span> assert(hashing::md5::sig2hex(sig4).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 343</span> assert(<a class="code hl_function" href="#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig4).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><span class="lineno"> 344</span> <span class="stringliteral">&quot;d174ab98d277d9f5a5611c2c9f419d9f&quot;</span>) == 0);</div>
<div class="line"><span class="lineno"> 345</span>}</div>
<div class="ttc" id="ashell__sort2_8cpp_html_a7eb77daed2cf1513f6d68c47a1c2db1c"><div class="ttname"><a href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a></div><div class="ttdeci">int compare(const void *a, const void *b)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d7a/shell__sort2_8cpp_source.html#l00087">shell_sort2.cpp:87</a></div></div>
@@ -768,7 +768,7 @@ false IF integers are detected to work as little-endian </dd></dl>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d5/d96/md5_8cpp.html">md5.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,13 +1,13 @@
var md5_8cpp =
[
[ "hash", "d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb", null ],
[ "hash_bs", "d5/d96/md5_8cpp.html#a5341431cef7fcfc33794326e1deb2425", null ],
[ "hashing::md5::hash", "d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb", null ],
[ "hashing::md5::hash_bs", "d5/d96/md5_8cpp.html#a5341431cef7fcfc33794326e1deb2425", null ],
[ "interactive", "d5/d96/md5_8cpp.html#ac9e1a11f44135b890dd10a00e73b5661", null ],
[ "isBigEndian", "d5/d96/md5_8cpp.html#af8e96bde0183c4b0a7ff04668f11e446", null ],
[ "leftRotate32bits", "d5/d96/md5_8cpp.html#add2bf982d5dd64a45d13cba52c2b371d", null ],
[ "hashing::md5::isBigEndian", "d5/d96/md5_8cpp.html#af8e96bde0183c4b0a7ff04668f11e446", null ],
[ "hashing::md5::leftRotate32bits", "d5/d96/md5_8cpp.html#add2bf982d5dd64a45d13cba52c2b371d", null ],
[ "main", "d5/d96/md5_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "sig2hex", "d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348", null ],
[ "hashing::md5::sig2hex", "d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348", null ],
[ "test", "d5/d96/md5_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
[ "toLittleEndian32", "d5/d96/md5_8cpp.html#a694712c9665051ba52b686387b87a689", null ],
[ "toLittleEndian64", "d5/d96/md5_8cpp.html#a6be48c1e6e742f9bd329f501d61dcaef", null ]
[ "hashing::md5::toLittleEndian32", "d5/d96/md5_8cpp.html#a694712c9665051ba52b686387b87a689", null ],
[ "hashing::md5::toLittleEndian64", "d5/d96/md5_8cpp.html#a6be48c1e6e742f9bd329f501d61dcaef", 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++: hashing/md5.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('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="headertitle"><div class="title">md5.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/d96/md5_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="../../d5/d96/md5_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="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor">#include &lt;algorithm&gt;</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#include &lt;array&gt;</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
@@ -133,7 +134,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="preprocessor">#include &lt;string&gt;</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor">#include &lt;vector&gt;</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="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d0c/namespacehashing.html">hashing</a> {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="keyword">namespace </span>md5 {</div>
<div class="foldopen" id="foldopen00067" data-start="{" data-end="}">
@@ -141,6 +142,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">return</span> (n &lt;&lt; rotate) | (n &gt;&gt; (32 - rotate));</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span>}</div>
</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span></div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#af8e96bde0183c4b0a7ff04668f11e446"> 77</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#af8e96bde0183c4b0a7ff04668f11e446">isBigEndian</a>() {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">union </span>{</div>
@@ -151,6 +153,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">return</span> bint.c[0] == 1;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>}</div>
</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span></div>
<div class="foldopen" id="foldopen00090" data-start="{" data-end="}">
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#a694712c9665051ba52b686387b87a689"> 90</a></span>uint32_t <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a694712c9665051ba52b686387b87a689">toLittleEndian32</a>(uint32_t n) {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d5/d96/md5_8cpp.html#af8e96bde0183c4b0a7ff04668f11e446">isBigEndian</a>()) {</div>
@@ -161,6 +164,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordflow">return</span> n;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span>}</div>
</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span></div>
<div class="foldopen" id="foldopen00103" data-start="{" data-end="}">
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#a6be48c1e6e742f9bd329f501d61dcaef"> 103</a></span>uint64_t <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a6be48c1e6e742f9bd329f501d61dcaef">toLittleEndian64</a>(uint64_t n) {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d5/d96/md5_8cpp.html#af8e96bde0183c4b0a7ff04668f11e446">isBigEndian</a>()) {</div>
@@ -178,6 +182,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> n;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div>
</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span></div>
<div class="foldopen" id="foldopen00123" data-start="{" data-end="}">
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348"> 123</a></span>std::string <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">sig2hex</a>(<span class="keywordtype">void</span>* sig) {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* hexChars = <span class="stringliteral">&quot;0123456789abcdef&quot;</span>;</div>
@@ -190,6 +195,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">return</span> hex;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span>}</div>
</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</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="../../d5/d96/md5_8cpp.html#a5341431cef7fcfc33794326e1deb2425"> 139</a></span><span class="keywordtype">void</span>* <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a5341431cef7fcfc33794326e1deb2425">hash_bs</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* input_bs, uint64_t input_size) {</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keyword">auto</span>* input = <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(input_bs);</div>
@@ -203,7 +209,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="comment">// K is pseudo-random values used each round</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="comment">// The values can be obtained by the following python code:</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> std::array&lt;uint32_t, 64&gt; K = {</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> 3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426,</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134,</div>
@@ -326,6 +332,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <span class="keywordflow">return</span> sig;</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="foldopen" id="foldopen00288" data-start="{" data-end="}">
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb"> 288</a></span><span class="keywordtype">void</span>* <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hash</a>(<span class="keyword">const</span> std::string&amp; message) {</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a5341431cef7fcfc33794326e1deb2425">hash_bs</a>(&amp;message[0], message.size());</div>
@@ -333,58 +340,58 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span>} <span class="comment">// namespace md5</span></div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span>} <span class="comment">// namespace hashing</span></div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> </div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span></div>
<div class="foldopen" id="foldopen00298" data-start="{" data-end="}">
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 298</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <span class="comment">// Hashes empty string and stores signature</span></div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="keywordtype">void</span>* sig = hashing::md5::hash(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="keywordtype">void</span>* sig = <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hashing::md5::hash</a>(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Hashing empty string&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> std::cout &lt;&lt; hashing::md5::sig2hex(sig) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> std::cout &lt;&lt; <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> assert(hashing::md5::sig2hex(sig).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> assert(<a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="stringliteral">&quot;d41d8cd98f00b204e9800998ecf8427e&quot;</span>) == 0);</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <span class="comment">// Hashes &quot;The quick brown fox jumps over the lazy dog&quot; and stores signature</span></div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordtype">void</span>* sig2 =</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> hashing::md5::hash(<span class="stringliteral">&quot;The quick brown fox jumps over the lazy dog&quot;</span>);</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hashing::md5::hash</a>(<span class="stringliteral">&quot;The quick brown fox jumps over the lazy dog&quot;</span>);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Hashing The quick brown fox jumps over the lazy dog&quot;</span></div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> std::cout &lt;&lt; hashing::md5::sig2hex(sig2) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> std::cout &lt;&lt; <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig2) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> assert(hashing::md5::sig2hex(sig2).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> assert(<a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig2).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> <span class="stringliteral">&quot;9e107d9d372bb6826bd81d3542a419d6&quot;</span>) == 0);</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> </div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="comment">// Hashes &quot;The quick brown fox jumps over the lazy dog.&quot; (notice the</span></div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> <span class="comment">// additional period) and stores signature</span></div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <span class="keywordtype">void</span>* sig3 =</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> hashing::md5::hash(<span class="stringliteral">&quot;The quick brown fox jumps over the lazy dog.&quot;</span>);</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hashing::md5::hash</a>(<span class="stringliteral">&quot;The quick brown fox jumps over the lazy dog.&quot;</span>);</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Hashing &quot;</span></div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> <span class="stringliteral">&quot;The quick brown fox jumps over the lazy dog.&quot;</span></div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> std::cout &lt;&lt; hashing::md5::sig2hex(sig3) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> std::cout &lt;&lt; <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig3) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> assert(hashing::md5::sig2hex(sig3).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> assert(<a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig3).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> <span class="stringliteral">&quot;e4d909c290d0fb1ca068ffaddf22cbd0&quot;</span>) == 0);</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> </div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> <span class="comment">// Hashes &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&quot;</span></div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> <span class="comment">// and stores signature</span></div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> <span class="keywordtype">void</span>* sig4 = hashing::md5::hash(</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> <span class="keywordtype">void</span>* sig4 = <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hashing::md5::hash</a>(</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <span class="stringliteral">&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&quot;</span>);</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> std::cout</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> &lt;&lt; <span class="stringliteral">&quot;Hashing &quot;</span></div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> <span class="stringliteral">&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789&quot;</span></div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <span class="comment">// Prints signature hex representation</span></div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> std::cout &lt;&lt; hashing::md5::sig2hex(sig4) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> std::cout &lt;&lt; <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig4) &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> <span class="comment">// Test with cassert whether sig is correct from the expected value</span></div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> assert(hashing::md5::sig2hex(sig4).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> assert(<a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig4).<a class="code hl_function" href="../../d4/d7a/shell__sort2_8cpp.html#a7eb77daed2cf1513f6d68c47a1c2db1c">compare</a>(</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> <span class="stringliteral">&quot;d174ab98d277d9f5a5611c2c9f419d9f&quot;</span>) == 0);</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span>}</div>
</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> </div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span></div>
<div class="foldopen" id="foldopen00352" data-start="{" data-end="}">
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#ac9e1a11f44135b890dd10a00e73b5661"> 352</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#ac9e1a11f44135b890dd10a00e73b5661">interactive</a>() {</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
@@ -392,8 +399,8 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Enter a message to be hashed (Ctrl-C to exit): &quot;</span></div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> std::getline(std::cin, input);</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> <span class="keywordtype">void</span>* sig = hashing::md5::hash(input);</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Hash is: &quot;</span> &lt;&lt; hashing::md5::sig2hex(sig) &lt;&lt; std::endl;</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> <span class="keywordtype">void</span>* sig = <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#a88705fab5f92adf3427b4cf76ff33edb">hashing::md5::hash</a>(input);</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Hash is: &quot;</span> &lt;&lt; <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aaee69c6136a841043f956de32116e348">hashing::md5::sig2hex</a>(sig) &lt;&lt; std::endl;</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> </div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Want to enter another message? (y/n) &quot;</span>;</div>
@@ -407,7 +414,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> }</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span>}</div>
</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> </div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span></div>
<div class="foldopen" id="foldopen00377" data-start="{" data-end="}">
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"><a class="line" href="../../d5/d96/md5_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 377</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> <a class="code hl_function" href="../../d5/d96/md5_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -436,7 +443,7 @@ $(function(){initNavTree('d5/d96/md5_8cpp_source.html','../../'); initResizable(
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_ece9b94c107bbaa1dd68197a8c9983b9.html">hashing</a></li><li class="navelem"><a class="el" href="../../d5/d96/md5_8cpp.html">md5.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++: node 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');
@@ -186,7 +186,7 @@ Public 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">
@@ -194,9 +194,8 @@ Public Attributes</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../d9/dcc/selectionsortlinkedlist_8cpp_source.html#l00009">9</a> of file <a class="el" href="../../d9/dcc/selectionsortlinkedlist_8cpp_source.html">selectionsortlinkedlist.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 9</span> {</div>
<div class="line"><span class="lineno"> 10</span> data = d;</div>
<div class="line"><span class="lineno"> 11</span> <a class="code hl_typedef" href="../../d1/df3/hash__search_8cpp.html#ad6fcd983304f85afa199d97a9b0ca9f6">link</a> = NULL;</div>
<div class="line"><span class="lineno"> 11</span> link = NULL;</div>
<div class="line"><span class="lineno"> 12</span> }</div>
<div class="ttc" id="ahash__search_8cpp_html_ad6fcd983304f85afa199d97a9b0ca9f6"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#ad6fcd983304f85afa199d97a9b0ca9f6">link</a></div><div class="ttdeci">struct list * link</div><div class="ttdoc">pointer to nodes</div></div>
</div><!-- fragment -->
</div>
</div>
@@ -395,7 +394,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/da1/structnode.html">node</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.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++: jarvis 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('d5/da7/namespacejarvis.html','../../'); initResizable(
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/da7/namespacejarvis.html">jarvis</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::list_array::list&lt; N &gt; Struct 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');
@@ -209,7 +209,7 @@ template&lt;uint64_t N&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">
@@ -230,25 +230,26 @@ template&lt;uint64_t N&gt; </div>
<div class="fragment"><div class="line"><span class="lineno"> 51</span> {</div>
<div class="line"><span class="lineno"> 52</span> <span class="comment">// If both pointer cross each other means no element present in the list</span></div>
<div class="line"><span class="lineno"> 53</span> <span class="comment">// which is equal to the val</span></div>
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (last &lt; first) {</div>
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">last</a> &lt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">first</a>) {</div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">return</span> -1;</div>
<div class="line"><span class="lineno"> 56</span> }</div>
<div class="line"><span class="lineno"> 57</span> uint64_t mid = (first + last) / 2;</div>
<div class="line"><span class="lineno"> 57</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a> = (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">first</a> + <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">last</a>) / 2;</div>
<div class="line"><span class="lineno"> 58</span> <span class="comment">// check whether current mid pointer value is equal to element or not</span></div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">if</span> (dataArr[mid] == val)</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">return</span> mid;</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">dataArr</a>[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a>] == <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>)</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a>;</div>
<div class="line"><span class="lineno"> 61</span> <span class="comment">// if current mid value is greater than element we have to search in</span></div>
<div class="line"><span class="lineno"> 62</span> <span class="comment">// first half</span></div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (val &lt; dataArr[mid])</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> (<a class="code hl_function" href="#a412bdb3910181f3c384d86aee7e217cf">BinarySearch</a>(dataArr, first, mid - 1, val));</div>
<div class="line"><span class="lineno"> 63</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a> &lt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">dataArr</a>[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a>])</div>
<div class="line"><span class="lineno"> 64</span> <span class="keywordflow">return</span> (<a class="code hl_function" href="#a412bdb3910181f3c384d86aee7e217cf">BinarySearch</a>(<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">dataArr</a>, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">first</a>, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a> - 1, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>));</div>
<div class="line"><span class="lineno"> 65</span> <span class="comment">// if current mid value is greater than element we have to search in</span></div>
<div class="line"><span class="lineno"> 66</span> <span class="comment">// second half</span></div>
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (val &gt; dataArr[mid])</div>
<div class="line"><span class="lineno"> 68</span> <span class="keywordflow">return</span> (<a class="code hl_function" href="#a412bdb3910181f3c384d86aee7e217cf">BinarySearch</a>(dataArr, mid + 1, last, val));</div>
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a> &gt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">dataArr</a>[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a>])</div>
<div class="line"><span class="lineno"> 68</span> <span class="keywordflow">return</span> (<a class="code hl_function" href="#a412bdb3910181f3c384d86aee7e217cf">BinarySearch</a>(<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">dataArr</a>, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">mid</a> + 1, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">last</a>, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>));</div>
<div class="line"><span class="lineno"> 69</span> </div>
<div class="line"><span class="lineno"> 70</span> std::cerr &lt;&lt; __func__ &lt;&lt; <span class="stringliteral">&quot;:&quot;</span> &lt;&lt; __LINE__ &lt;&lt; <span class="stringliteral">&quot;: Undefined condition\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 70</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cerr</a> &lt;&lt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">__func__</a> &lt;&lt; <span class="stringliteral">&quot;:&quot;</span> &lt;&lt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">__LINE__</a> &lt;&lt; <span class="stringliteral">&quot;: Undefined condition\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 71</span> <span class="keywordflow">return</span> -1;</div>
<div class="line"><span class="lineno"> 72</span> }</div>
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html"><div class="ttname"><a href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">data_structures::list_array::list</a></div><div class="ttdoc">Structure of List with supporting methods.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d00/list__array_8cpp_source.html#l00037">list_array.cpp:37</a></div></div>
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_a412bdb3910181f3c384d86aee7e217cf"><div class="ttname"><a href="#a412bdb3910181f3c384d86aee7e217cf">data_structures::list_array::list::BinarySearch</a></div><div class="ttdeci">uint64_t BinarySearch(const std::array&lt; uint64_t, N &gt; &amp;dataArr, const uint64_t &amp;first, const uint64_t &amp;last, const uint64_t &amp;val)</div><div class="ttdoc">Search an element in the list using binarySearch.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d00/list__array_8cpp_source.html#l00049">list_array.cpp:49</a></div></div>
</div><!-- fragment -->
</div>
@@ -273,7 +274,7 @@ template&lt;uint64_t N&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">
@@ -290,36 +291,36 @@ template&lt;uint64_t N&gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d7/d00/list__array_8cpp_source.html#l00143">143</a> of file <a class="el" href="../../d7/d00/list__array_8cpp_source.html">list_array.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 143</span> {</div>
<div class="line"><span class="lineno"> 144</span> <span class="comment">// overflow check</span></div>
<div class="line"><span class="lineno"> 145</span> <span class="keywordflow">if</span> (top == N) {</div>
<div class="line"><span class="lineno"> 146</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nOverflow&quot;</span>;</div>
<div class="line"><span class="lineno"> 145</span> <span class="keywordflow">if</span> (top == <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">N</a>) {</div>
<div class="line"><span class="lineno"> 146</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nOverflow&quot;</span>;</div>
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 148</span> }</div>
<div class="line"><span class="lineno"> 149</span> <span class="comment">// if list is not sorted, insert at the last</span></div>
<div class="line"><span class="lineno"> 150</span> <span class="comment">// otherwise place it to correct position</span></div>
<div class="line"><span class="lineno"> 151</span> <span class="keywordflow">if</span> (!isSorted) {</div>
<div class="line"><span class="lineno"> 152</span> data[top] = val;</div>
<div class="line"><span class="lineno"> 152</span> data[top] = <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>;</div>
<div class="line"><span class="lineno"> 153</span> top++;</div>
<div class="line"><span class="lineno"> 154</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 155</span> uint64_t pos = 0; <span class="comment">// Initialize the index variable</span></div>
<div class="line"><span class="lineno"> 155</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> = 0; <span class="comment">// Initialize the index variable</span></div>
<div class="line"><span class="lineno"> 156</span> <span class="comment">// Going through each element and find correct position for element</span></div>
<div class="line"><span class="lineno"> 157</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; top - 1; i++) {</div>
<div class="line"><span class="lineno"> 157</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> = 0; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> &lt; top - 1; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>++) {</div>
<div class="line"><span class="lineno"> 158</span> <span class="comment">// check for the correct position</span></div>
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">if</span> (data[i] &lt;= val &amp;&amp; val &lt;= data[i + 1]) {</div>
<div class="line"><span class="lineno"> 160</span> pos = i + 1; <span class="comment">// assign correct pos to the index var</span></div>
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">if</span> (data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>] &lt;= <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a> &amp;&amp; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a> &lt;= data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> + 1]) {</div>
<div class="line"><span class="lineno"> 160</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> = <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> + 1; <span class="comment">// assign correct pos to the index var</span></div>
<div class="line"><span class="lineno"> 161</span> <span class="keywordflow">break</span>; <span class="comment">// to get out from the loop</span></div>
<div class="line"><span class="lineno"> 162</span> }</div>
<div class="line"><span class="lineno"> 163</span> }</div>
<div class="line"><span class="lineno"> 164</span> <span class="comment">// if all elements are smaller than the element</span></div>
<div class="line"><span class="lineno"> 165</span> <span class="keywordflow">if</span> (pos == 0) {</div>
<div class="line"><span class="lineno"> 166</span> pos = top - 1;</div>
<div class="line"><span class="lineno"> 165</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> == 0) {</div>
<div class="line"><span class="lineno"> 166</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> = top - 1;</div>
<div class="line"><span class="lineno"> 167</span> }</div>
<div class="line"><span class="lineno"> 168</span> <span class="comment">// shift all element to make a room for new element</span></div>
<div class="line"><span class="lineno"> 169</span> <span class="keywordflow">for</span> (uint64_t i = top; i &gt; pos; i--) {</div>
<div class="line"><span class="lineno"> 170</span> data[i] = data[i - 1];</div>
<div class="line"><span class="lineno"> 169</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> = top; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> &gt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>--) {</div>
<div class="line"><span class="lineno"> 170</span> data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>] = data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> - 1];</div>
<div class="line"><span class="lineno"> 171</span> }</div>
<div class="line"><span class="lineno"> 172</span> top++; <span class="comment">// Increment the value of top.</span></div>
<div class="line"><span class="lineno"> 173</span> data[pos] =</div>
<div class="line"><span class="lineno"> 174</span> val; <span class="comment">// Assign the value to the correct index in the array</span></div>
<div class="line"><span class="lineno"> 173</span> data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>] =</div>
<div class="line"><span class="lineno"> 174</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>; <span class="comment">// Assign the value to the correct index in the array</span></div>
<div class="line"><span class="lineno"> 175</span> }</div>
<div class="line"><span class="lineno"> 176</span> }</div>
</div><!-- fragment -->
@@ -349,7 +350,7 @@ template&lt;uint64_t N&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">
@@ -367,9 +368,9 @@ template&lt;uint64_t N&gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d7/d00/list__array_8cpp_source.html#l00080">80</a> of file <a class="el" href="../../d7/d00/list__array_8cpp_source.html">list_array.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 81</span> {</div>
<div class="line"><span class="lineno"> 82</span> <span class="comment">// Going through each element in the list</span></div>
<div class="line"><span class="lineno"> 83</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; top; i++) {</div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordflow">if</span> (dataArr[i] == val) {</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">return</span> i; <span class="comment">// element found at ith index</span></div>
<div class="line"><span class="lineno"> 83</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> = 0; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> &lt; top; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>++) {</div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">dataArr</a>[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>] == <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>) {</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>; <span class="comment">// element found at ith index</span></div>
<div class="line"><span class="lineno"> 86</span> }</div>
<div class="line"><span class="lineno"> 87</span> }</div>
<div class="line"><span class="lineno"> 88</span> <span class="comment">// element is not present in the list</span></div>
@@ -398,7 +399,7 @@ template&lt;uint64_t N&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">
@@ -414,22 +415,20 @@ template&lt;uint64_t N&gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d7/d00/list__array_8cpp_source.html#l00183">183</a> of file <a class="el" href="../../d7/d00/list__array_8cpp_source.html">list_array.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 183</span> {</div>
<div class="line"><span class="lineno"> 184</span> uint64_t pos = <a class="code hl_namespace" href="../../d9/dca/namespacesearch.html">search</a>(val); <span class="comment">// search the index of the value</span></div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> = search(<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>); <span class="comment">// search the index of the value</span></div>
<div class="line"><span class="lineno"> 185</span> <span class="comment">// if search returns -1, element does not present in the list</span></div>
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">if</span> (pos == -1) {</div>
<div class="line"><span class="lineno"> 187</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\n Element does not present in the list &quot;</span>;</div>
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> == -1) {</div>
<div class="line"><span class="lineno"> 187</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n Element does not present in the list &quot;</span>;</div>
<div class="line"><span class="lineno"> 188</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 189</span> }</div>
<div class="line"><span class="lineno"> 190</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span></div>
<div class="line"><span class="lineno"> 191</span> &lt;&lt; data[pos] &lt;&lt; <span class="stringliteral">&quot; deleted&quot;</span>; <span class="comment">// print the appropriate message</span></div>
<div class="line"><span class="lineno"> 190</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span></div>
<div class="line"><span class="lineno"> 191</span> &lt;&lt; data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>] &lt;&lt; <span class="stringliteral">&quot; deleted&quot;</span>; <span class="comment">// print the appropriate message</span></div>
<div class="line"><span class="lineno"> 192</span> <span class="comment">// shift all the element 1 left to fill vacant space</span></div>
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">for</span> (uint64_t i = pos; i &lt; top; i++) {</div>
<div class="line"><span class="lineno"> 194</span> <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>[i] = <a class="code hl_variable" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>[i + 1];</div>
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> = <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> &lt; top; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>++) {</div>
<div class="line"><span class="lineno"> 194</span> data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>] = data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> + 1];</div>
<div class="line"><span class="lineno"> 195</span> }</div>
<div class="line"><span class="lineno"> 196</span> top--; <span class="comment">// decrement the top variable to maintain last index</span></div>
<div class="line"><span class="lineno"> 197</span> }</div>
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition</b> <a href="../../d1/df3/hash__search_8cpp_source.html#l00024">hash_search.cpp:24</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="../../df/dd5/binary__search_8cpp_source.html#l00047">binary_search.cpp:47</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -453,30 +452,30 @@ template&lt;uint64_t N&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">
<p class="definition">Definition at line <a class="el" href="../../d7/d00/list__array_8cpp_source.html#l00097">97</a> of file <a class="el" href="../../d7/d00/list__array_8cpp_source.html">list_array.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 97</span> {</div>
<div class="line"><span class="lineno"> 98</span> uint64_t pos; <span class="comment">// pos variable to store index value of element.</span></div>
<div class="line"><span class="lineno"> 98</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>; <span class="comment">// pos variable to store index value of element.</span></div>
<div class="line"><span class="lineno"> 99</span> <span class="comment">// if list is sorted, binary search works efficiently else linear search</span></div>
<div class="line"><span class="lineno"> 100</span> <span class="comment">// is the only option</span></div>
<div class="line"><span class="lineno"> 101</span> <span class="keywordflow">if</span> (isSorted) {</div>
<div class="line"><span class="lineno"> 102</span> pos = <a class="code hl_function" href="#a412bdb3910181f3c384d86aee7e217cf">BinarySearch</a>(data, 0, top - 1, val);</div>
<div class="line"><span class="lineno"> 102</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> = <a class="code hl_function" href="#a412bdb3910181f3c384d86aee7e217cf">BinarySearch</a>(data, 0, top - 1, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>);</div>
<div class="line"><span class="lineno"> 103</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 104</span> pos = <a class="code hl_function" href="#ad202ae68fe8d98082afa9dafea9e22b9">LinearSearch</a>(data, val);</div>
<div class="line"><span class="lineno"> 104</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> = <a class="code hl_function" href="#ad202ae68fe8d98082afa9dafea9e22b9">LinearSearch</a>(data, <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">val</a>);</div>
<div class="line"><span class="lineno"> 105</span> }</div>
<div class="line"><span class="lineno"> 106</span> <span class="comment">// if index is equal to -1 means element does not present</span></div>
<div class="line"><span class="lineno"> 107</span> <span class="comment">// else print the index of that element</span></div>
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">if</span> (pos != -1) {</div>
<div class="line"><span class="lineno"> 109</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nElement found at position : &quot;</span> &lt;&lt; pos;</div>
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a> != -1) {</div>
<div class="line"><span class="lineno"> 109</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nElement found at position : &quot;</span> &lt;&lt; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>;</div>
<div class="line"><span class="lineno"> 110</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 111</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nElement not found&quot;</span>;</div>
<div class="line"><span class="lineno"> 111</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nElement not found&quot;</span>;</div>
<div class="line"><span class="lineno"> 112</span> }</div>
<div class="line"><span class="lineno"> 113</span> <span class="comment">// return the index of element or -1.</span></div>
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">return</span> pos;</div>
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">pos</a>;</div>
<div class="line"><span class="lineno"> 115</span> }</div>
<div class="ttc" id="astructdata__structures_1_1list__array_1_1list_html_ad202ae68fe8d98082afa9dafea9e22b9"><div class="ttname"><a href="#ad202ae68fe8d98082afa9dafea9e22b9">data_structures::list_array::list::LinearSearch</a></div><div class="ttdeci">uint64_t LinearSearch(const std::array&lt; uint64_t, N &gt; &amp;dataArr, const uint64_t &amp;val) const</div><div class="ttdoc">Search an element using linear search.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d00/list__array_8cpp_source.html#l00080">list_array.cpp:80</a></div></div>
</div><!-- fragment -->
@@ -502,7 +501,7 @@ template&lt;uint64_t N&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">
@@ -513,9 +512,9 @@ template&lt;uint64_t N&gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d7/d00/list__array_8cpp_source.html#l00203">203</a> of file <a class="el" href="../../d7/d00/list__array_8cpp_source.html">list_array.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 203</span> {</div>
<div class="line"><span class="lineno"> 204</span> <span class="comment">// Going through each element in the list</span></div>
<div class="line"><span class="lineno"> 205</span> std::cout &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;</div>
<div class="line"><span class="lineno"> 206</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; top; i++) {</div>
<div class="line"><span class="lineno"> 207</span> std::cout &lt;&lt; data[i] &lt;&lt; <span class="stringliteral">&quot; &quot;</span>; <span class="comment">// print the element</span></div>
<div class="line"><span class="lineno"> 205</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;</div>
<div class="line"><span class="lineno"> 206</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> = 0; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> &lt; top; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>++) {</div>
<div class="line"><span class="lineno"> 207</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::cout</a> &lt;&lt; data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>] &lt;&lt; <span class="stringliteral">&quot; &quot;</span>; <span class="comment">// print the element</span></div>
<div class="line"><span class="lineno"> 208</span> }</div>
<div class="line"><span class="lineno"> 209</span> }</div>
</div><!-- fragment -->
@@ -541,7 +540,7 @@ template&lt;uint64_t N&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">
@@ -552,16 +551,16 @@ template&lt;uint64_t N&gt; </div>
<p class="definition">Definition at line <a class="el" href="../../d7/d00/list__array_8cpp_source.html#l00121">121</a> of file <a class="el" href="../../d7/d00/list__array_8cpp_source.html">list_array.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 121</span> {</div>
<div class="line"><span class="lineno"> 122</span> <span class="comment">// Going through each element in the list</span></div>
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">for</span> (uint64_t i = 0; i &lt; top; i++) {</div>
<div class="line"><span class="lineno"> 124</span> uint64_t min_idx = i; <span class="comment">// Initialize the min variable</span></div>
<div class="line"><span class="lineno"> 125</span> <span class="keywordflow">for</span> (uint64_t j = i + 1; j &lt; top; j++) {</div>
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> = 0; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> &lt; top; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>++) {</div>
<div class="line"><span class="lineno"> 124</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">min_idx</a> = <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>; <span class="comment">// Initialize the min variable</span></div>
<div class="line"><span class="lineno"> 125</span> <span class="keywordflow">for</span> (<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">uint64_t</a> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">j</a> = <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a> + 1; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">j</a> &lt; top; <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">j</a>++) {</div>
<div class="line"><span class="lineno"> 126</span> <span class="comment">// check whether any element less than current min value</span></div>
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">if</span> (data[j] &lt; data[min_idx]) {</div>
<div class="line"><span class="lineno"> 128</span> min_idx = j; <span class="comment">// update index accordingly</span></div>
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">if</span> (data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">j</a>] &lt; data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">min_idx</a>]) {</div>
<div class="line"><span class="lineno"> 128</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">min_idx</a> = <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">j</a>; <span class="comment">// update index accordingly</span></div>
<div class="line"><span class="lineno"> 129</span> }</div>
<div class="line"><span class="lineno"> 130</span> }</div>
<div class="line"><span class="lineno"> 131</span> <span class="comment">// swap min value and element at the ith index</span></div>
<div class="line"><span class="lineno"> 132</span> std::swap(data[min_idx], data[i]);</div>
<div class="line"><span class="lineno"> 132</span> <a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">std::swap</a>(data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">min_idx</a>], data[<a class="code hl_struct" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">i</a>]);</div>
<div class="line"><span class="lineno"> 133</span> }</div>
<div class="line"><span class="lineno"> 134</span> <span class="comment">// mark isSorted variable as true</span></div>
<div class="line"><span class="lineno"> 135</span> isSorted = <span class="keyword">true</span>;</div>
@@ -634,7 +633,7 @@ template&lt;uint64_t N&gt; </div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><b>list_array</b></li><li class="navelem"><a class="el" href="../../d5/dab/structdata__structures_1_1list__array_1_1list.html">list</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/magic_number.cpp Pages: 1 -->
<svg width="191pt" height="83pt"

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.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/magic_number.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++: machine_learning/adaline_learning.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');
@@ -153,6 +153,8 @@ Include dependency graph for adaline_learning.cpp:</div>
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="../../d6/d30/classmachine__learning_1_1adaline.html">machine_learning::adaline</a></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="../../d8/df2/classadaline.html">adaline</a></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="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
@@ -263,9 +265,9 @@ Variables</h2></td></tr>
<div class="fragment"><div class="line"><span class="lineno"> 224</span> {</div>
<div class="line"><span class="lineno"> 225</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> ada(2, eta); <span class="comment">// 2 features</span></div>
<div class="line"><span class="lineno"> 226</span> </div>
<div class="line"><span class="lineno"> 227</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 10; <span class="comment">// number of sample points</span></div>
<div class="line"><span class="lineno"> 227</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = 10; <span class="comment">// number of sample points</span></div>
<div class="line"><span class="lineno"> 228</span> </div>
<div class="line"><span class="lineno"> 229</span> std::array&lt;std::vector&lt;double&gt;, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>&gt; X = {</div>
<div class="line"><span class="lineno"> 229</span> std::array&lt;std::vector&lt;double&gt;, N&gt; X = {</div>
<div class="line"><span class="lineno"> 230</span> std::vector&lt;double&gt;({0, 1}), std::vector&lt;double&gt;({1, -2}),</div>
<div class="line"><span class="lineno"> 231</span> std::vector&lt;double&gt;({2, 3}), std::vector&lt;double&gt;({3, -1}),</div>
<div class="line"><span class="lineno"> 232</span> std::vector&lt;double&gt;({4, 1}), std::vector&lt;double&gt;({6, -5}),</div>
@@ -277,7 +279,7 @@ Variables</h2></td></tr>
<div class="line"><span class="lineno"> 238</span> std::cout &lt;&lt; <span class="stringliteral">&quot;------- Test 1 -------&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 239</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Model before fit: &quot;</span> &lt;&lt; ada &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 240</span> </div>
<div class="line"><span class="lineno"> 241</span> ada.fit&lt;<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>&gt;(X, y);</div>
<div class="line"><span class="lineno"> 241</span> ada.fit&lt;N&gt;(X, y);</div>
<div class="line"><span class="lineno"> 242</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Model after fit: &quot;</span> &lt;&lt; ada &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 243</span> </div>
<div class="line"><span class="lineno"> 244</span> <span class="keywordtype">int</span> predict = ada.predict({5, -3});</div>
@@ -291,7 +293,6 @@ Variables</h2></td></tr>
<div class="line"><span class="lineno"> 252</span> std::cout &lt;&lt; <span class="stringliteral">&quot; ...passed&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 253</span>}</div>
<div class="ttc" id="aclassmachine__learning_1_1adaline_html"><div class="ttname"><a href="../../d6/d30/classmachine__learning_1_1adaline.html">machine_learning::adaline</a></div><div class="ttdef"><b>Definition</b> <a href="../../d5/db0/adaline__learning_8cpp_source.html#l00046">adaline_learning.cpp:46</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>
@@ -320,16 +321,16 @@ Variables</h2></td></tr>
<div class="fragment"><div class="line"><span class="lineno"> 262</span> {</div>
<div class="line"><span class="lineno"> 263</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> ada(2, eta); <span class="comment">// 2 features</span></div>
<div class="line"><span class="lineno"> 264</span> </div>
<div class="line"><span class="lineno"> 265</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 50; <span class="comment">// number of sample points</span></div>
<div class="line"><span class="lineno"> 265</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = 50; <span class="comment">// number of sample points</span></div>
<div class="line"><span class="lineno"> 266</span> </div>
<div class="line"><span class="lineno"> 267</span> std::array&lt;std::vector&lt;double&gt;, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>&gt; X;</div>
<div class="line"><span class="lineno"> 267</span> std::array&lt;std::vector&lt;double&gt;, N&gt; X;</div>
<div class="line"><span class="lineno"> 268</span> std::array&lt;int, N&gt; Y{}; <span class="comment">// corresponding y-values</span></div>
<div class="line"><span class="lineno"> 269</span> </div>
<div class="line"><span class="lineno"> 270</span> <span class="comment">// generate sample points in the interval</span></div>
<div class="line"><span class="lineno"> 271</span> <span class="comment">// [-range2/100 , (range2-1)/100]</span></div>
<div class="line"><span class="lineno"> 272</span> <span class="keywordtype">int</span> range = 500; <span class="comment">// sample points full-range</span></div>
<div class="line"><span class="lineno"> 273</span> <span class="keywordtype">int</span> range2 = range &gt;&gt; 1; <span class="comment">// sample points half-range</span></div>
<div class="line"><span class="lineno"> 274</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> 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"> 274</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; N; i++) {</div>
<div class="line"><span class="lineno"> 275</span> <span class="keywordtype">double</span> x0 = (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(std::rand() % range) - range2) / 100.f;</div>
<div class="line"><span class="lineno"> 276</span> <span class="keywordtype">double</span> x1 = (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(std::rand() % range) - range2) / 100.f;</div>
<div class="line"><span class="lineno"> 277</span> X[i] = std::vector&lt;double&gt;({x0, x1});</div>
@@ -385,16 +386,16 @@ Variables</h2></td></tr>
<div class="fragment"><div class="line"><span class="lineno"> 313</span> {</div>
<div class="line"><span class="lineno"> 314</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> ada(6, eta); <span class="comment">// 2 features</span></div>
<div class="line"><span class="lineno"> 315</span> </div>
<div class="line"><span class="lineno"> 316</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> = 100; <span class="comment">// number of sample points</span></div>
<div class="line"><span class="lineno"> 316</span> <span class="keyword">const</span> <span class="keywordtype">int</span> N = 100; <span class="comment">// number of sample points</span></div>
<div class="line"><span class="lineno"> 317</span> </div>
<div class="line"><span class="lineno"> 318</span> std::array&lt;std::vector&lt;double&gt;, <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>&gt; X;</div>
<div class="line"><span class="lineno"> 318</span> std::array&lt;std::vector&lt;double&gt;, N&gt; X;</div>
<div class="line"><span class="lineno"> 319</span> std::array&lt;int, N&gt; Y{}; <span class="comment">// corresponding y-values</span></div>
<div class="line"><span class="lineno"> 320</span> </div>
<div class="line"><span class="lineno"> 321</span> <span class="comment">// generate sample points in the interval</span></div>
<div class="line"><span class="lineno"> 322</span> <span class="comment">// [-range2/100 , (range2-1)/100]</span></div>
<div class="line"><span class="lineno"> 323</span> <span class="keywordtype">int</span> range = 200; <span class="comment">// sample points full-range</span></div>
<div class="line"><span class="lineno"> 324</span> <span class="keywordtype">int</span> range2 = range &gt;&gt; 1; <span class="comment">// sample points half-range</span></div>
<div class="line"><span class="lineno"> 325</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> 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"> 325</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; N; i++) {</div>
<div class="line"><span class="lineno"> 326</span> <span class="keywordtype">double</span> x0 = (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(std::rand() % range) - range2) / 100.f;</div>
<div class="line"><span class="lineno"> 327</span> <span class="keywordtype">double</span> x1 = (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(std::rand() % range) - range2) / 100.f;</div>
<div class="line"><span class="lineno"> 328</span> <span class="keywordtype">double</span> x2 = (<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(std::rand() % range) - range2) / 100.f;</div>
@@ -433,7 +434,7 @@ Variables</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_3343723ae086de42ee4ca9774da3a13f.html">machine_learning</a></li><li class="navelem"><a class="el" href="../../d5/db0/adaline__learning_8cpp.html">adaline_learning.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,7 @@
var adaline__learning_8cpp =
[
[ "machine_learning::adaline", "d6/d30/classmachine__learning_1_1adaline.html", "d6/d30/classmachine__learning_1_1adaline" ],
[ "adaline", "d8/df2/classadaline.html", "d8/df2/classadaline" ],
[ "main", "d5/db0/adaline__learning_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627", null ],
[ "test1", "d5/db0/adaline__learning_8cpp.html#a52053d88ea1bcbbed9aca67ab4eeb499", null ],
[ "test2", "d5/db0/adaline__learning_8cpp.html#a379f7488a305f2571f2932b319931f82", 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++: machine_learning/adaline_learning.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('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="headertitle"><div class="title">adaline_learning.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/db0/adaline__learning_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="../../d5/db0/adaline__learning_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="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include &lt;climits&gt;</span></div>
@@ -134,12 +135,12 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include &lt;numeric&gt;</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor">#include &lt;vector&gt;</span></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="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../d9/d66/group__machine__learning.html#ga5118e5cbc4f0886e27b3a7a2544dded1"> 40</a></span><span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="../../d9/d66/group__machine__learning.html#ga5118e5cbc4f0886e27b3a7a2544dded1">MAX_ITER</a> = 500; <span class="comment">// INT_MAX</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/d77/namespacemachine__learning.html">machine_learning</a> {</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/d30/classmachine__learning_1_1adaline.html"> 46</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../d8/df2/classadaline.html"> 46</a></span><span class="keyword">class </span><a class="code hl_function" href="../../d8/df2/classadaline.html#a0acbe32aaab897e7939e5b0454035b8c">adaline</a> {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d6/d30/classmachine__learning_1_1adaline.html#a0acbe32aaab897e7939e5b0454035b8c"> 55</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#a0acbe32aaab897e7939e5b0454035b8c">adaline</a>(<span class="keywordtype">int</span> num_features, <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="../../d6/d30/classmachine__learning_1_1adaline.html#a28160d17e492597a2f112e0d38551cda">eta</a> = 0.01f,</div>
@@ -160,9 +161,9 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// weights[i] = (static_cast&lt;double&gt;(std::rand() % 100) - 50);</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> }</div>
</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="foldopen" id="foldopen00076" data-start="{" data-end="};">
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../d6/d30/classmachine__learning_1_1adaline.html#ae347040516e995c8fb8ca2e5c0496daa"> 76</a></span> <span class="keyword">friend</span> std::ostream &amp;<a class="code hl_friend" href="../../d6/d30/classmachine__learning_1_1adaline.html#ae347040516e995c8fb8ca2e5c0496daa">operator&lt;&lt;</a>(std::ostream &amp;out, <span class="keyword">const</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> &amp;ada) {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</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="../../d6/d30/classmachine__learning_1_1adaline.html#ae347040516e995c8fb8ca2e5c0496daa"> 76</a></span> <span class="keyword">friend</span> std::ostream &amp;<a class="code hl_friend" href="../../d6/d30/classmachine__learning_1_1adaline.html#ae347040516e995c8fb8ca2e5c0496daa">operator&lt;&lt;</a>(std::ostream &amp;out, <span class="keyword">const</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#a0acbe32aaab897e7939e5b0454035b8c">adaline</a> &amp;ada) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> out &lt;&lt; <span class="stringliteral">&quot;&lt;&quot;</span>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; ada.<a class="code hl_variable" href="../../d6/d30/classmachine__learning_1_1adaline.html#a4cd8fe438032fedaa66f93bfd66f5492">weights</a>.size(); i++) {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> out &lt;&lt; ada.<a class="code hl_variable" href="../../d6/d30/classmachine__learning_1_1adaline.html#a4cd8fe438032fedaa66f93bfd66f5492">weights</a>[i];</div>
@@ -174,7 +175,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">return</span> out;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span></div>
<div class="foldopen" id="foldopen00095" data-start="{" data-end="}">
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="../../d6/d30/classmachine__learning_1_1adaline.html#ab11242d9ad5b03a75911e29b04f78fd3"> 95</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#ab11242d9ad5b03a75911e29b04f78fd3">predict</a>(<span class="keyword">const</span> std::vector&lt;double&gt; &amp;x, <span class="keywordtype">double</span> *out = <span class="keyword">nullptr</span>) {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#ac8a9c2aaaa63b0f27ea176857e1e7d56">check_size_match</a>(x)) {</div>
@@ -193,7 +194,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#a082f758fb55fe19f22b3df66f89b2325">activation</a>(y); <span class="comment">// quantizer: apply ADALINE threshold function</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> }</div>
</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span></div>
<div class="foldopen" id="foldopen00119" data-start="{" data-end="}">
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="../../d6/d30/classmachine__learning_1_1adaline.html#a74e3c6c037b67895014414c5d75465e5"> 119</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#a74e3c6c037b67895014414c5d75465e5">fit</a>(<span class="keyword">const</span> std::vector&lt;double&gt; &amp;x, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;y) {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#ac8a9c2aaaa63b0f27ea176857e1e7d56">check_size_match</a>(x)) {</div>
@@ -214,7 +215,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">return</span> correction_factor;</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="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keyword">template</span> &lt;<span class="keywordtype">size_t</span> N&gt;</div>
<div class="foldopen" id="foldopen00145" data-start="{" data-end="}">
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="../../d6/d30/classmachine__learning_1_1adaline.html#a8d61f9ed872eef26bca39388cbda6a91"> 145</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#a8d61f9ed872eef26bca39388cbda6a91">fit</a>(std::array&lt;std::vector&lt;double&gt;, N&gt; <span class="keyword">const</span> &amp;X,</div>
@@ -248,7 +249,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> }</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> }</div>
</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="../../d6/d30/classmachine__learning_1_1adaline.html#a082f758fb55fe19f22b3df66f89b2325"> 186</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d6/d30/classmachine__learning_1_1adaline.html#a082f758fb55fe19f22b3df66f89b2325">activation</a>(<span class="keywordtype">double</span> x) { <span class="keywordflow">return</span> x &gt; 0 ? 1 : -1; }</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keyword">private</span>:</div>
@@ -274,7 +275,8 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span>} <span class="comment">// namespace machine_learning</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span><span class="keyword">using </span><a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">machine_learning::adaline</a>;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span></div>
<div class="foldopen" id="foldopen00224" data-start="{" data-end="}">
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="../../d5/db0/adaline__learning_8cpp.html#a52053d88ea1bcbbed9aca67ab4eeb499"> 224</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>(<span class="keywordtype">double</span> eta = 0.01) {</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> ada(2, eta); <span class="comment">// 2 features</span></div>
@@ -307,7 +309,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> std::cout &lt;&lt; <span class="stringliteral">&quot; ...passed&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span>}</div>
</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> </div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span></div>
<div class="foldopen" id="foldopen00262" data-start="{" data-end="}">
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"><a class="line" href="../../d5/db0/adaline__learning_8cpp.html#a379f7488a305f2571f2932b319931f82"> 262</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>(<span class="keywordtype">double</span> eta = 0.01) {</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> ada(2, eta); <span class="comment">// 2 features</span></div>
@@ -349,7 +351,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> }</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span>}</div>
</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> </div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span></div>
<div class="foldopen" id="foldopen00313" data-start="{" data-end="}">
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"><a class="line" href="../../d5/db0/adaline__learning_8cpp.html#a992bdf1fdb0b9d414bcf7981d2d87aa9"> 313</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d0c/hamiltons__cycle_8cpp.html#a0cc94918b6831f308d4fe4fa27f08299">test3</a>(<span class="keywordtype">double</span> eta = 0.01) {</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <a class="code hl_class" href="../../d6/d30/classmachine__learning_1_1adaline.html">adaline</a> ada(6, eta); <span class="comment">// 2 features</span></div>
@@ -394,7 +396,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> }</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span>}</div>
</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> </div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span></div>
<div class="foldopen" id="foldopen00357" data-start="{" data-end="}">
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"><a class="line" href="../../d5/db0/adaline__learning_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627"> 357</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="l00358" name="l00358"></a><span class="lineno"> 358</span> std::srand(std::time(<span class="keyword">nullptr</span>)); <span class="comment">// initialize random number generator</span></div>
@@ -419,6 +421,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span>}</div>
</div>
<div class="ttc" id="aclassadaline_html_a0acbe32aaab897e7939e5b0454035b8c"><div class="ttname"><a href="../../d8/df2/classadaline.html#a0acbe32aaab897e7939e5b0454035b8c">adaline::adaline</a></div><div class="ttdeci">adaline(int num_features, const double eta=0.01f, const double accuracy=1e-5)</div><div class="ttdef"><b>Definition</b> <a href="#l00055">adaline_learning.cpp:55</a></div></div>
<div class="ttc" id="aclassmachine__learning_1_1adaline_html"><div class="ttname"><a href="../../d6/d30/classmachine__learning_1_1adaline.html">machine_learning::adaline</a></div><div class="ttdef"><b>Definition</b> <a href="#l00046">adaline_learning.cpp:46</a></div></div>
<div class="ttc" id="aclassmachine__learning_1_1adaline_html_a082f758fb55fe19f22b3df66f89b2325"><div class="ttname"><a href="../../d6/d30/classmachine__learning_1_1adaline.html#a082f758fb55fe19f22b3df66f89b2325">machine_learning::adaline::activation</a></div><div class="ttdeci">int activation(double x)</div><div class="ttdef"><b>Definition</b> <a href="#l00186">adaline_learning.cpp:186</a></div></div>
<div class="ttc" id="aclassmachine__learning_1_1adaline_html_a0acbe32aaab897e7939e5b0454035b8c"><div class="ttname"><a href="../../d6/d30/classmachine__learning_1_1adaline.html#a0acbe32aaab897e7939e5b0454035b8c">machine_learning::adaline::adaline</a></div><div class="ttdeci">adaline(int num_features, const double eta=0.01f, const double accuracy=1e-5)</div><div class="ttdef"><b>Definition</b> <a href="#l00055">adaline_learning.cpp:55</a></div></div>
@@ -442,7 +445,7 @@ $(function(){initNavTree('d5/db0/adaline__learning_8cpp_source.html','../../');
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_3343723ae086de42ee4ca9774da3a13f.html">machine_learning</a></li><li class="navelem"><a class="el" href="../../d5/db0/adaline__learning_8cpp.html">adaline_learning.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++: operations_on_datastructures::inorder_traversal_of_bst::Node 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');
@@ -216,7 +216,7 @@ Public Attributes</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a></li><li class="navelem"><b>inorder_traversal_of_bst</b></li><li class="navelem"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.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++: bit_manipulation/set_kth_bit.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,14 +230,12 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 45</span> <span class="comment">// that no Overflow can be there.</span></div>
<div class="line"><span class="lineno"> 46</span> </div>
<div class="line"><span class="lineno"> 47</span> <span class="keywordtype">int</span> pos =</div>
<div class="line"><span class="lineno"> 48</span> 1 &lt;&lt; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>; <span class="comment">// &quot;pos&quot; variable is used to store 1 at kth postion and</span></div>
<div class="line"><span class="lineno"> 48</span> 1 &lt;&lt; k; <span class="comment">// &quot;pos&quot; variable is used to store 1 at kth postion and</span></div>
<div class="line"><span class="lineno"> 49</span> <span class="comment">// rest bits are 0. in binary representation of number &#39;n&#39;</span></div>
<div class="line"><span class="lineno"> 50</span> </div>
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a> | pos; <span class="comment">// by taking or with the pos and the N we set the bit of N</span></div>
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">return</span> N | pos; <span class="comment">// by taking or with the pos and the N we set the bit of N</span></div>
<div class="line"><span class="lineno"> 52</span> <span class="comment">// at kth position.</span></div>
<div class="line"><span class="lineno"> 53</span>}</div>
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
<div class="ttc" id="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>
@@ -259,7 +257,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">
@@ -270,16 +268,17 @@ Functions</h2></td></tr>
<p class="definition">Definition at line <a class="el" href="../../d5/db5/set__kth__bit_8cpp_source.html#l00061">61</a> of file <a class="el" href="../../d5/db5/set__kth__bit_8cpp_source.html">set_kth_bit.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 61</span> {</div>
<div class="line"><span class="lineno"> 62</span> <span class="comment">// n = 10,2 return 14</span></div>
<div class="line"><span class="lineno"> 63</span> assert(bit_manipulation::set_kth_bit::setKthBit(10, 2) == 14);</div>
<div class="line"><span class="lineno"> 63</span> assert(<a class="code hl_function" href="#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(10, 2) == 14);</div>
<div class="line"><span class="lineno"> 64</span> <span class="comment">// n = 25,1 return 27</span></div>
<div class="line"><span class="lineno"> 65</span> assert(bit_manipulation::set_kth_bit::setKthBit(25, 1) == 27);</div>
<div class="line"><span class="lineno"> 65</span> assert(<a class="code hl_function" href="#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(25, 1) == 27);</div>
<div class="line"><span class="lineno"> 66</span> <span class="comment">// n = 400001,5 return 400033</span></div>
<div class="line"><span class="lineno"> 67</span> assert(bit_manipulation::set_kth_bit::setKthBit(400001, 5) == 400033);</div>
<div class="line"><span class="lineno"> 67</span> assert(<a class="code hl_function" href="#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(400001, 5) == 400033);</div>
<div class="line"><span class="lineno"> 68</span> <span class="comment">// n = 123 return 123</span></div>
<div class="line"><span class="lineno"> 69</span> assert(bit_manipulation::set_kth_bit::setKthBit(123, 3) == 123);</div>
<div class="line"><span class="lineno"> 69</span> assert(<a class="code hl_function" href="#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(123, 3) == 123);</div>
<div class="line"><span class="lineno"> 70</span> </div>
<div class="line"><span class="lineno"> 71</span> std::cout &lt;&lt; <span class="stringliteral">&quot;All test cases successfully passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 72</span>}</div>
<div class="ttc" id="aset__kth__bit_8cpp_html_ad4d0ffd9331242c42a28834ee19f5fd9"><div class="ttname"><a href="#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a></div><div class="ttdeci">std::uint64_t setKthBit(std ::int64_t N, std ::int64_t k)</div><div class="ttdoc">The main function implements set kth bit.</div><div class="ttdef"><b>Definition</b> <a href="../../d5/db5/set__kth__bit_8cpp_source.html#l00043">set_kth_bit.cpp:43</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -289,7 +288,7 @@ Functions</h2></td></tr>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d5/db5/set__kth__bit_8cpp.html">set_kth_bit.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 set__kth__bit_8cpp =
[
[ "main", "d5/db5/set__kth__bit_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "setKthBit", "d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9", null ],
[ "bit_manipulation::set_kth_bit::setKthBit", "d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9", null ],
[ "test", "d5/db5/set__kth__bit_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++: bit_manipulation/set_kth_bit.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,11 +124,12 @@ $(function(){initNavTree('d5/db5/set__kth__bit_8cpp_source.html','../../'); init
<div class="headertitle"><div class="title">set_kth_bit.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/db5/set__kth__bit_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="../../d5/db5/set__kth__bit_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &lt;cassert&gt;</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a> {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">namespace </span>set_kth_bit {</div>
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
@@ -146,21 +147,22 @@ $(function(){initNavTree('d5/db5/set__kth__bit_8cpp_source.html','../../'); init
</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span>} <span class="comment">// namespace set_kth_bit</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span>} <span class="comment">// namespace bit_manipulation</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="foldopen" id="foldopen00061" data-start="{" data-end="}">
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d5/db5/set__kth__bit_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 61</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// n = 10,2 return 14</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> assert(bit_manipulation::set_kth_bit::setKthBit(10, 2) == 14);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> assert(<a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(10, 2) == 14);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">// n = 25,1 return 27</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> assert(bit_manipulation::set_kth_bit::setKthBit(25, 1) == 27);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> assert(<a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(25, 1) == 27);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// n = 400001,5 return 400033</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> assert(bit_manipulation::set_kth_bit::setKthBit(400001, 5) == 400033);</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> assert(<a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(400001, 5) == 400033);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// n = 123 return 123</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> assert(bit_manipulation::set_kth_bit::setKthBit(123, 3) == 123);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> assert(<a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a>(123, 3) == 123);</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> std::cout &lt;&lt; <span class="stringliteral">&quot;All test cases successfully passed!&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span>}</div>
</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span></div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../d5/db5/set__kth__bit_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 77</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_function" href="../../d5/db5/set__kth__bit_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
@@ -170,6 +172,7 @@ $(function(){initNavTree('d5/db5/set__kth__bit_8cpp_source.html','../../'); init
<div class="ttc" id="anamespacebit__manipulation_html"><div class="ttname"><a href="../../d7/d81/namespacebit__manipulation.html">bit_manipulation</a></div><div class="ttdoc">for assert</div></div>
<div class="ttc" id="anamespaceset_kth_bit_html"><div class="ttname"><a href="../../d8/d88/namespaceset_kth_bit.html">setKthBit</a></div><div class="ttdoc">Functions for the [From the right, set the Kth bit in the binary representation of N] (https://practi...</div></div>
<div class="ttc" id="aset__kth__bit_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d5/db5/set__kth__bit_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="#l00061">set_kth_bit.cpp:61</a></div></div>
<div class="ttc" id="aset__kth__bit_8cpp_html_ad4d0ffd9331242c42a28834ee19f5fd9"><div class="ttname"><a href="../../d5/db5/set__kth__bit_8cpp.html#ad4d0ffd9331242c42a28834ee19f5fd9">bit_manipulation::set_kth_bit::setKthBit</a></div><div class="ttdeci">std::uint64_t setKthBit(std ::int64_t N, std ::int64_t k)</div><div class="ttdoc">The main function implements set kth bit.</div><div class="ttdef"><b>Definition</b> <a href="#l00043">set_kth_bit.cpp:43</a></div></div>
<div class="ttc" id="aset__kth__bit_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d5/db5/set__kth__bit_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="#l00077">set_kth_bit.cpp:77</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
@@ -177,7 +180,7 @@ $(function(){initNavTree('d5/db5/set__kth__bit_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_f3c4fbc4e901afa0a54d0623c5574aa7.html">bit_manipulation</a></li><li class="navelem"><a class="el" href="../../d5/db5/set__kth__bit_8cpp.html">set_kth_bit.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++: mincoins_topdown 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('d5/db8/namespacemincoins__topdown.html','../../'); ini
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../d5/db8/namespacemincoins__topdown.html">mincoins_topdown</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/integral_approximation.cpp Pages: 1 -->
<svg width="329pt" 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: math/integral_approximation.cpp Pages: 1 -->
<svg width="329pt" 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: data_structures::Node Pages: 1 -->
<svg width="172pt" height="194pt"

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.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: data_structures::Node Pages: 1 -->
<svg width="172pt" height="194pt"

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.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++: data_structures/morrisinorder.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');
@@ -237,7 +237,7 @@ $(function(){initNavTree('d5/dc5/morrisinorder_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_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><b>morrisinorder.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>

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