Documentation for c26eea874d
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -152,7 +152,7 @@ $(function(){initNavTree('d9/dde/classbinary__search__tree.html','../../'); init
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: backtracking/sudoku_solver.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -242,7 +242,7 @@ template<size_t V> </div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><span class="lineno"> 52</span></div>
|
||||
<div class="line"><span class="lineno"> 54</span> <span class="keywordtype">int</span> sx = (i / 3) * 3;</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordtype">int</span> sy = (j / 3) * 3;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> </div>
|
||||
@@ -291,13 +291,15 @@ template<size_t V> </div>
|
||||
<div class="line"><span class="lineno"> 164</span> std::array<int, V>{0, 0, 0, 4, 1, 9, 0, 0, 5},</div>
|
||||
<div class="line"><span class="lineno"> 165</span> std::array<int, V>{0, 0, 0, 0, 8, 0, 0, 7, 9}};</div>
|
||||
<div class="line"><span class="lineno"> 166</span> </div>
|
||||
<div class="line"><span class="lineno"> 167</span> backtracking::sudoku_solver::printMat<V>(mat, mat, 9);</div>
|
||||
<div class="line"><span class="lineno"> 167</span> <a class="code hl_function" href="#ab040a12d7684cd85fb3684f4211ea5ac">backtracking::sudoku_solver::printMat<V></a>(mat, mat, 9);</div>
|
||||
<div class="line"><span class="lineno"> 168</span> std::cout << <span class="stringliteral">"Solution "</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 169</span> std::array<std::array<int, V>, V> starting_mat = mat;</div>
|
||||
<div class="line"><span class="lineno"> 170</span> backtracking::sudoku_solver::solveSudoku<V>(mat, starting_mat, 0, 0);</div>
|
||||
<div class="line"><span class="lineno"> 170</span> <a class="code hl_function" href="#ac911c8bca8556206ff64461b2424866b">backtracking::sudoku_solver::solveSudoku<V></a>(mat, starting_mat, 0, 0);</div>
|
||||
<div class="line"><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 173</span>}</div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_ab040a12d7684cd85fb3684f4211ea5ac"><div class="ttname"><a href="#ab040a12d7684cd85fb3684f4211ea5ac">backtracking::sudoku_solver::printMat</a></div><div class="ttdeci">void printMat(const std::array< std::array< int, V >, V > &mat, const std::array< std::array< int, V >, V > &starting_mat, int n)</div><div class="ttdoc">Utility function to print the matrix.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d05/sudoku__solver_8cpp_source.html#l00077">sudoku_solver.cpp:77</a></div></div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_ac911c8bca8556206ff64461b2424866b"><div class="ttname"><a href="#ac911c8bca8556206ff64461b2424866b">backtracking::sudoku_solver::solveSudoku</a></div><div class="ttdeci">bool solveSudoku(std::array< std::array< int, V >, V > &mat, const std::array< std::array< int, V >, V > &starting_mat, int i, int j)</div><div class="ttdoc">Main function to implement the Sudoku algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d05/sudoku__solver_8cpp_source.html#l00110">sudoku_solver.cpp:110</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -429,21 +431,21 @@ template<size_t V> </div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/d05/sudoku__solver_8cpp_source.html#l00110">110</a> of file <a class="el" href="../../d3/d05/sudoku__solver_8cpp_source.html">sudoku_solver.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 112</span> {</div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="keywordflow">if</span> (i == 9) {</div>
|
||||
<div class="line"><span class="lineno"> 116</span> printMat<V>(mat, starting_mat, 9);</div>
|
||||
<div class="line"><span class="lineno"> 116</span> <a class="code hl_function" href="#ab040a12d7684cd85fb3684f4211ea5ac">printMat<V></a>(mat, starting_mat, 9);</div>
|
||||
<div class="line"><span class="lineno"> 117</span> <span class="keywordflow">return</span> <span class="keyword">true</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> <span class="keywordflow">if</span> (j == 9) {</div>
|
||||
<div class="line"><span class="lineno"> 122</span> <span class="keywordflow">return</span> solveSudoku<V>(mat, starting_mat, i + 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 123</span> }</div>
|
||||
<div class="line"><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><span class="lineno"> 124</span></div>
|
||||
<div class="line"><span class="lineno"> 126</span> <span class="keywordflow">if</span> (mat[i][j] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">return</span> solveSudoku<V>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><span class="lineno"> 128</span> }</div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> no = 1; no <= 9; no++) {</div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">if</span> (isPossible<V>(mat, i, j, no, 9)) {</div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a07dc6acffd0500de9bdbf16b3ade94b0">isPossible<V></a>(mat, i, j, no, 9)) {</div>
|
||||
<div class="line"><span class="lineno"> 134</span> mat[i][j] = no;</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="keywordtype">bool</span> solution_found = solveSudoku<V>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="keywordtype">bool</span> solution_found = <a class="code hl_function" href="#ac911c8bca8556206ff64461b2424866b">solveSudoku<V></a>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">if</span> (solution_found) {</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 138</span> }</div>
|
||||
@@ -452,6 +454,7 @@ template<size_t V> </div>
|
||||
<div class="line"><span class="lineno"> 144</span> mat[i][j] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 146</span>}</div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_a07dc6acffd0500de9bdbf16b3ade94b0"><div class="ttname"><a href="#a07dc6acffd0500de9bdbf16b3ade94b0">backtracking::sudoku_solver::isPossible</a></div><div class="ttdeci">bool isPossible(const std::array< std::array< int, V >, V > &mat, int i, int j, int no, int n)</div><div class="ttdoc">Check if it's possible to place a number (no parameter)</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d05/sudoku__solver_8cpp_source.html#l00044">sudoku_solver.cpp:44</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -461,7 +464,7 @@ template<size_t V> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d3/d05/sudoku__solver_8cpp.html">sudoku_solver.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>
|
||||
|
||||
6
d3/d05/sudoku__solver_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var sudoku__solver_8cpp =
|
||||
[
|
||||
[ "isPossible", "d3/d05/sudoku__solver_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0", null ],
|
||||
[ "backtracking::sudoku_solver::isPossible", "d3/d05/sudoku__solver_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0", null ],
|
||||
[ "main", "d3/d05/sudoku__solver_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "printMat", "d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac", null ],
|
||||
[ "solveSudoku", "d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b", null ]
|
||||
[ "backtracking::sudoku_solver::printMat", "d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac", null ],
|
||||
[ "backtracking::sudoku_solver::solveSudoku", "d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: backtracking/sudoku_solver.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,10 +124,10 @@ $(function(){initNavTree('d3/d05/sudoku__solver_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">sudoku_solver.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d05/sudoku__solver_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="../../d3/d05/sudoku__solver_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><span class="preprocessor">#include <array></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../db/dc0/namespacebacktracking.html">backtracking</a> {</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="../../d8/d9f/namespacesudoku__solver.html">sudoku_solver</a> {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> V></div>
|
||||
@@ -139,7 +139,7 @@ $(function(){initNavTree('d3/d05/sudoku__solver_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">int</span> sx = (i / 3) * 3;</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">int</span> sy = (j / 3) * 3;</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||
@@ -154,6 +154,7 @@ $(function(){initNavTree('d3/d05/sudoku__solver_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</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="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> V></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="../../d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac"> 77</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac">printMat</a>(<span class="keyword">const</span> std::array<std::array<int, V>, V> &mat,</div>
|
||||
@@ -177,28 +178,28 @@ $(function(){initNavTree('d3/d05/sudoku__solver_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>}</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="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> V></div>
|
||||
<div class="foldopen" id="foldopen00110" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b"> 110</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b">solveSudoku</a>(std::array<std::array<int, V>, V> &mat,</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">const</span> std::array<std::array<int, V>, V> &starting_mat, <span class="keywordtype">int</span> i,</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordtype">int</span> j) {</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">if</span> (i == 9) {</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> printMat<V>(mat, starting_mat, 9);</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac">printMat<V></a>(mat, starting_mat, 9);</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> <span class="keyword">true</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> <span class="keywordflow">if</span> (j == 9) {</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> solveSudoku<V>(mat, starting_mat, i + 1, 0);</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b">solveSudoku<V></a>(mat, starting_mat, i + 1, 0);</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">if</span> (mat[i][j] != 0) {</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> solveSudoku<V>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b">solveSudoku<V></a>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> no = 1; no <= 9; no++) {</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (isPossible<V>(mat, i, j, no, 9)) {</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0">isPossible<V></a>(mat, i, j, no, 9)) {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> mat[i][j] = no;</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordtype">bool</span> solution_found = solveSudoku<V>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordtype">bool</span> solution_found = <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b">solveSudoku<V></a>(mat, starting_mat, i, j + 1);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordflow">if</span> (solution_found) {</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
|
||||
@@ -210,7 +211,7 @@ $(function(){initNavTree('d3/d05/sudoku__solver_8cpp_source.html','../../'); ini
|
||||
</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span>} <span class="comment">// namespace sudoku_solver</span></div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>} <span class="comment">// namespace backtracking</span></div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span></div>
|
||||
<div class="foldopen" id="foldopen00154" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="../../d3/d05/sudoku__solver_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 154</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="keyword">const</span> <span class="keywordtype">int</span> V = 9;</div>
|
||||
@@ -225,17 +226,17 @@ $(function(){initNavTree('d3/d05/sudoku__solver_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> std::array<int, V>{0, 0, 0, 4, 1, 9, 0, 0, 5},</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> std::array<int, V>{0, 0, 0, 0, 8, 0, 0, 7, 9}};</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> backtracking::sudoku_solver::printMat<V>(mat, mat, 9);</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac">backtracking::sudoku_solver::printMat<V></a>(mat, mat, 9);</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> std::cout << <span class="stringliteral">"Solution "</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> std::array<std::array<int, V>, V> starting_mat = mat;</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> backtracking::sudoku_solver::solveSudoku<V>(mat, starting_mat, 0, 0);</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <a class="code hl_function" href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b">backtracking::sudoku_solver::solveSudoku<V></a>(mat, starting_mat, 0, 0);</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="anamespacebacktracking_html"><div class="ttname"><a href="../../db/dc0/namespacebacktracking.html">backtracking</a></div><div class="ttdoc">for vector container</div></div>
|
||||
<div class="ttc" id="anamespacesudoku__solver_html"><div class="ttname"><a href="../../d8/d9f/namespacesudoku__solver.html">sudoku_solver</a></div><div class="ttdoc">Functions for the Sudoku Solver implementation.</div></div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_a07dc6acffd0500de9bdbf16b3ade94b0"><div class="ttname"><a href="../../d3/d05/sudoku__solver_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0">backtracking::sudoku_solver::isPossible</a></div><div class="ttdeci">bool isPossible(const std::array< std::array< int, V >, V > &mat, int i, int j, int no, int n)</div><div class="ttdoc">Check if it's possible to place a number (no parameter)</div><div class="ttdef"><b>Definition</b> <a href="#l00044">sudoku_solver.cpp:44</a></div></div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_a07dc6acffd0500de9bdbf16b3ade94b0"><div class="ttname"><a href="../../d3/d05/sudoku__solver_8cpp.html#a07dc6acffd0500de9bdbf16b3ade94b0">backtracking::sudoku_solver::isPossible</a></div><div class="ttdeci">bool isPossible(const std::array< std::array< int, V >, V > &mat, int i, int j, int no, int n)</div><div class="ttdoc">Check if it's possible to place a number (no parameter)</div><div class="ttdef"><b>Definition</b> <a href="#l00044">sudoku_solver.cpp:44</a></div></div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_ab040a12d7684cd85fb3684f4211ea5ac"><div class="ttname"><a href="../../d3/d05/sudoku__solver_8cpp.html#ab040a12d7684cd85fb3684f4211ea5ac">backtracking::sudoku_solver::printMat</a></div><div class="ttdeci">void printMat(const std::array< std::array< int, V >, V > &mat, const std::array< std::array< int, V >, V > &starting_mat, int n)</div><div class="ttdoc">Utility function to print the matrix.</div><div class="ttdef"><b>Definition</b> <a href="#l00077">sudoku_solver.cpp:77</a></div></div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_ac911c8bca8556206ff64461b2424866b"><div class="ttname"><a href="../../d3/d05/sudoku__solver_8cpp.html#ac911c8bca8556206ff64461b2424866b">backtracking::sudoku_solver::solveSudoku</a></div><div class="ttdeci">bool solveSudoku(std::array< std::array< int, V >, V > &mat, const std::array< std::array< int, V >, V > &starting_mat, int i, int j)</div><div class="ttdoc">Main function to implement the Sudoku algorithm.</div><div class="ttdef"><b>Definition</b> <a href="#l00110">sudoku_solver.cpp:110</a></div></div>
|
||||
<div class="ttc" id="asudoku__solver_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d05/sudoku__solver_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="#l00154">sudoku_solver.cpp:154</a></div></div>
|
||||
@@ -245,7 +246,7 @@ $(function(){initNavTree('d3/d05/sudoku__solver_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_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d3/d05/sudoku__solver_8cpp.html">sudoku_solver.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/ode_semi_implicit_euler.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -165,18 +165,16 @@ Functions</h2></td></tr>
|
||||
<div class="textblock"><p>Solve a multivariable first order <a href="https://en.wikipedia.org/wiki/Ordinary_differential_equation" target="_blank">ordinary differential equation (ODEs)</a> using <a href="https://en.wikipedia.org/wiki/Semi-implicit_Euler_method" target="_blank">semi implicit Euler method</a> </p>
|
||||
<dl class="section author"><dt>Authors</dt><dd><a href="https://github.com/kvedala" target="_blank">Krishna Vedala</a> </dd></dl>
|
||||
<p>The ODE being solved is: </p><p class="formulaDsp">
|
||||
\begin{eqnarray*}
|
||||
\dot{u} &=& v\\
|
||||
\begin{eqnarray*} \dot{u} &=& v\\
|
||||
\dot{v} &=& -\omega^2 u\\
|
||||
\omega &=& 1\\
|
||||
[x_0, u_0, v_0] &=& [0,1,0]\qquad\ldots\text{(initial values)}
|
||||
\end{eqnarray*}
|
||||
\end{eqnarray*}
|
||||
</p>
|
||||
<p> The exact solution for the above problem is: </p><p class="formulaDsp">
|
||||
\begin{eqnarray*}
|
||||
u(x) &=& \cos(x)\\
|
||||
\begin{eqnarray*} u(x) &=& \cos(x)\\
|
||||
v(x) &=& -\sin(x)\\
|
||||
\end{eqnarray*}
|
||||
\end{eqnarray*}
|
||||
</p>
|
||||
<p> The computation results are stored to a text file <code>semi_implicit_euler.csv</code> and the exact soltuion results in <code>exact.csv</code> for comparison. <img src="https://raw.githubusercontent.com/TheAlgorithms/C-Plus-Plus/docs/images/numerical_methods/ode_semi_implicit_euler.svg" alt="Implementation solution" style="pointer-events: none;" class="inline"/></p>
|
||||
<p>To implement <a href="https://en.wikipedia.org/wiki/Van_der_Pol_oscillator" target="_blank">Van der Pol oscillator</a>, change the <a class="el" href="#abaeae8f62a018d197f0187a1c80a90fe" title="Problem statement for a system with first-order differential equations. Updates the system differenti...">problem</a> function to: </p><div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">double</span> mu = 2.0;</div>
|
||||
@@ -395,7 +393,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html">ode_semi_implicit_euler.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/ode_semi_implicit_euler.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,13 +124,14 @@ $(function(){initNavTree('d3/d06/ode__semi__implicit__euler_8cpp_source.html','.
|
||||
<div class="headertitle"><div class="title">ode_semi_implicit_euler.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d06/ode__semi__implicit__euler_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="../../d3/d06/ode__semi__implicit__euler_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="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#include <cmath></span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="preprocessor">#include <ctime></span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#include <fstream></span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#include <valarray></span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span></div>
|
||||
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#abaeae8f62a018d197f0187a1c80a90fe"> 53</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#abaeae8f62a018d197f0187a1c80a90fe">problem</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> &x, std::valarray<double> *y,</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> std::valarray<double> *dy) {</div>
|
||||
@@ -139,14 +140,14 @@ $(function(){initNavTree('d3/d06/ode__semi__implicit__euler_8cpp_source.html','.
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> dy[0][1] = -omega * omega * y[0][0]; <span class="comment">// y dot</span></div>
|
||||
<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> </div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</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="../../d3/d06/ode__semi__implicit__euler_8cpp.html#af3adf7b092a87868917ee5fb4255192b"> 66</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#af3adf7b092a87868917ee5fb4255192b">exact_solution</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> &x, std::valarray<double> *y) {</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> y[0][0] = std::cos(x);</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> y[0][1] = -std::sin(x);</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="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</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="../../d6/d60/group__ode.html#ga827bf009831ddc477c5fa8891d5cb35f"> 82</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d6/d60/group__ode.html#ga827bf009831ddc477c5fa8891d5cb35f">semi_implicit_euler_step</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> dx, <span class="keyword">const</span> <span class="keywordtype">double</span> &x,</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> std::valarray<double> *y,</div>
|
||||
@@ -159,7 +160,7 @@ $(function(){initNavTree('d3/d06/ode__semi__implicit__euler_8cpp_source.html','.
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> y[0] += dy[0] * dx; <span class="comment">// update remaining using new dy</span></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="foldopen00103" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="../../d6/d60/group__ode.html#ga3874d294ab00fe9ce8731c5b7991a089"> 103</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d6/d60/group__ode.html#ga3874d294ab00fe9ce8731c5b7991a089">semi_implicit_euler</a>(<span class="keywordtype">double</span> dx, <span class="keywordtype">double</span> x0, <span class="keywordtype">double</span> x_max,</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::valarray<double> *y,</div>
|
||||
@@ -201,7 +202,8 @@ $(function(){initNavTree('d3/d06/ode__semi__implicit__euler_8cpp_source.html','.
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(t2 - t1) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span></div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span></div>
|
||||
<div class="foldopen" id="foldopen00153" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"><a class="line" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#aa13517b8e5de1b75592052db7f7e237f"> 153</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#aa13517b8e5de1b75592052db7f7e237f">save_exact_solution</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> &X0, <span class="keyword">const</span> <span class="keywordtype">double</span> &X_MAX,</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keyword">const</span> <span class="keywordtype">double</span> &step_size,</div>
|
||||
@@ -236,7 +238,7 @@ $(function(){initNavTree('d3/d06/ode__semi__implicit__euler_8cpp_source.html','.
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> fp.close();</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> </div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span></div>
|
||||
<div class="foldopen" id="foldopen00189" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"><a class="line" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97"> 189</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="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordtype">double</span> X0 = 0.f; <span class="comment">/* initial value of x0 */</span></div>
|
||||
@@ -274,7 +276,7 @@ $(function(){initNavTree('d3/d06/ode__semi__implicit__euler_8cpp_source.html','.
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d3/d06/ode__semi__implicit__euler_8cpp.html">ode_semi_implicit_euler.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/node.hpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -153,13 +153,13 @@ Classes</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:a990a87f74d83899124b2254bef8d0e98" id="r_a990a87f74d83899124b2254bef8d0e98"><td class="memTemplParams" colspan="2">template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a> , typename Action > </td></tr>
|
||||
<tr class="memitem:a990a87f74d83899124b2254bef8d0e98" id="r_a990a87f74d83899124b2254bef8d0e98"><td class="memTemplParams" colspan="2">template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>, typename Action> </td></tr>
|
||||
<tr class="memitem:a990a87f74d83899124b2254bef8d0e98"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a990a87f74d83899124b2254bef8d0e98">traverse</a> (const <a class="el" href="../../db/d8b/struct_node.html">Node</a> *const inNode, const Action &action)</td></tr>
|
||||
<tr class="separator:a990a87f74d83899124b2254bef8d0e98"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aed1593858f6a7284d21caa8839b65520" id="r_aed1593858f6a7284d21caa8839b65520"><td class="memTemplParams" colspan="2">template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a> > </td></tr>
|
||||
<tr class="memitem:aed1593858f6a7284d21caa8839b65520" id="r_aed1593858f6a7284d21caa8839b65520"><td class="memTemplParams" colspan="2">template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>> </td></tr>
|
||||
<tr class="memitem:aed1593858f6a7284d21caa8839b65520"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aed1593858f6a7284d21caa8839b65520">display_all</a> (const <a class="el" href="../../db/d8b/struct_node.html">Node</a> *const inNode)</td></tr>
|
||||
<tr class="separator:aed1593858f6a7284d21caa8839b65520"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a134faa726adc30b00d03454f77b87a0f" id="r_a134faa726adc30b00d03454f77b87a0f"><td class="memTemplParams" colspan="2">template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a> > </td></tr>
|
||||
<tr class="memitem:a134faa726adc30b00d03454f77b87a0f" id="r_a134faa726adc30b00d03454f77b87a0f"><td class="memTemplParams" colspan="2">template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>> </td></tr>
|
||||
<tr class="memitem:a134faa726adc30b00d03454f77b87a0f"><td class="memTemplItemLeft" align="right" valign="top">std::vector< typename Node::value_type > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a134faa726adc30b00d03454f77b87a0f">push_all_to_vector</a> (const <a class="el" href="../../db/d8b/struct_node.html">Node</a> *const inNode, const std::size_t expected_size=0)</td></tr>
|
||||
<tr class="separator:a134faa726adc30b00d03454f77b87a0f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
@@ -174,7 +174,7 @@ Functions</h2></td></tr>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a> > </div>
|
||||
template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void display_all </td>
|
||||
@@ -200,7 +200,7 @@ template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a> > </div>
|
||||
template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">std::vector< typename Node::value_type > push_all_to_vector </td>
|
||||
@@ -232,7 +232,7 @@ template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a> , typename Action > </div>
|
||||
template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>, typename Action> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void traverse </td>
|
||||
@@ -263,7 +263,7 @@ template<typename <a class="el" href="../../db/d8b/struct_node.html">Node</a>
|
||||
<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="../../d3/d09/node_8hpp.html">node.hpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -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/node.hpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,14 +124,14 @@ $(function(){initNavTree('d3/d09/node_8hpp_source.html','../../'); initResizable
|
||||
<div class="headertitle"><div class="title">node.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d09/node_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d3/d09/node_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#ifndef DATA_STRUCTURES_NODE_HPP_</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#define DATA_STRUCTURES_NODE_HPP_</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <memory></span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <vector></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="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="keyword">template</span> <<span class="keyword">class</span> ValueType></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">struct </span><a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> {</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">using </span>value_type = ValueType;</div>
|
||||
@@ -171,7 +171,7 @@ $(function(){initNavTree('d3/d09/node_8hpp_source.html','../../'); initResizable
|
||||
<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="../../d3/d09/node_8hpp.html">node.hpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -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::Stack< T > Pages: 1 -->
|
||||
<svg width="147pt" height="160pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures::Stack< T > Pages: 1 -->
|
||||
<svg width="147pt" height="160pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: util_functions Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d3/d17/namespaceutil__functions.html','../../'); initR
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d3/d17/namespaceutil__functions.html">util_functions</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/sparse_matrix.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -211,7 +211,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d3/d19/sparse__matrix_8cpp.html">sparse_matrix.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/sparse_matrix.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,9 +124,10 @@ $(function(){initNavTree('d3/d19/sparse__matrix_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">sparse_matrix.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d19/sparse__matrix_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="../../d3/d19/sparse__matrix_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span> </div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span></div>
|
||||
<div class="foldopen" id="foldopen00009" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="../../d3/d19/sparse__matrix_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 9</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d19/sparse__matrix_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> <span class="keywordtype">int</span> m, n;</div>
|
||||
@@ -176,7 +177,7 @@ $(function(){initNavTree('d3/d19/sparse__matrix_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_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d3/d19/sparse__matrix_8cpp.html">sparse_matrix.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: ciphers/hill_cipher.cpp Pages: 1 -->
|
||||
<!--zoomable 149 -->
|
||||
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: ciphers/hill_cipher.cpp Pages: 1 -->
|
||||
<svg width="661pt" height="149pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/modular_inverse_fermat_little_theorem.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/modular_inverse_fermat_little_theorem.cpp Pages: 1 -->
|
||||
<svg width="191pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -142,7 +142,7 @@ $(function(){initNavTree('d5/dab/structdata__structures_1_1list__array_1_1list.h
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -134,7 +134,7 @@ $(function(){initNavTree('da/d61/structsearch_1_1sublist__search_1_1_node.html',
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/quick_sort_iterative.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -253,7 +253,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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d3/d22/quick__sort__iterative_8cpp.html">quick_sort_iterative.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
4
d3/d22/quick__sort__iterative_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var quick__sort__iterative_8cpp =
|
||||
[
|
||||
[ "iterativeQuickSort", "d3/d22/quick__sort__iterative_8cpp.html#a263595fd9a0163b5b997b89fab3a0dc5", null ],
|
||||
[ "sorting::iterativeQuickSort", "d5/d91/namespacesorting.html#a263595fd9a0163b5b997b89fab3a0dc5", null ],
|
||||
[ "main", "d3/d22/quick__sort__iterative_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "partition", "d3/d22/quick__sort__iterative_8cpp.html#aac8f44b28b4aa96444383030b28f8b34", null ],
|
||||
[ "sorting::partition", "d5/d91/namespacesorting.html#aac8f44b28b4aa96444383030b28f8b34", null ],
|
||||
[ "tests", "d3/d22/quick__sort__iterative_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/quick_sort_iterative.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,14 +124,15 @@ $(function(){initNavTree('d3/d22/quick__sort__iterative_8cpp_source.html','../..
|
||||
<div class="headertitle"><div class="title">quick_sort_iterative.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d22/quick__sort__iterative_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="../../d3/d22/quick__sort__iterative_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <stack></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <cassert></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> </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/d91/namespacesorting.html">sorting</a> {</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="../../d5/d91/namespacesorting.html#aac8f44b28b4aa96444383030b28f8b34"> 33</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#aac8f44b28b4aa96444383030b28f8b34">partition</a>(std::vector<int> &arr, <span class="keywordtype">int</span> start, <span class="keywordtype">int</span> end)</div>
|
||||
@@ -149,11 +150,11 @@ $(function(){initNavTree('d3/d22/quick__sort__iterative_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">return</span> index + 1;</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span></div>
|
||||
<div class="foldopen" id="foldopen00058" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="../../d5/d91/namespacesorting.html#a263595fd9a0163b5b997b89fab3a0dc5"> 58</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a263595fd9a0163b5b997b89fab3a0dc5">iterativeQuickSort</a>(std::vector<int> &arr)</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>{</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::stack<int> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::stack<int> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>;</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">int</span> start = 0;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordtype">int</span> end = arr.size()-1;</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><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>
|
||||
@@ -215,7 +216,7 @@ $(function(){initNavTree('d3/d22/quick__sort__iterative_8cpp_source.html','../..
|
||||
<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="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="../../d3/d22/quick__sort__iterative_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 128</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d22/quick__sort__iterative_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>()</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span>{</div>
|
||||
@@ -230,7 +231,6 @@ $(function(){initNavTree('d3/d22/quick__sort__iterative_8cpp_source.html','../..
|
||||
<div class="ttc" id="anamespacesorting_html"><div class="ttname"><a href="../../d5/d91/namespacesorting.html">sorting</a></div><div class="ttdoc">for working with vectors</div></div>
|
||||
<div class="ttc" id="anamespacesorting_html_a263595fd9a0163b5b997b89fab3a0dc5"><div class="ttname"><a href="../../d5/d91/namespacesorting.html#a263595fd9a0163b5b997b89fab3a0dc5">sorting::iterativeQuickSort</a></div><div class="ttdeci">void iterativeQuickSort(std::vector< int > &arr)</div><div class="ttdoc">The main sorting function.</div><div class="ttdef"><b>Definition</b> <a href="#l00058">quick_sort_iterative.cpp:58</a></div></div>
|
||||
<div class="ttc" id="anamespacesorting_html_aac8f44b28b4aa96444383030b28f8b34"><div class="ttname"><a href="../../d5/d91/namespacesorting.html#aac8f44b28b4aa96444383030b28f8b34">sorting::partition</a></div><div class="ttdeci">int partition(std::vector< int > &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="#l00033">quick_sort_iterative.cpp:33</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="aquick__sort__iterative_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="../../d3/d22/quick__sort__iterative_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00094">quick_sort_iterative.cpp:94</a></div></div>
|
||||
<div class="ttc" id="aquick__sort__iterative_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d22/quick__sort__iterative_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="#l00128">quick_sort_iterative.cpp:128</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -239,7 +239,7 @@ $(function(){initNavTree('d3/d22/quick__sort__iterative_8cpp_source.html','../..
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d3/d22/quick__sort__iterative_8cpp.html">quick_sort_iterative.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/saddleback_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&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -279,7 +279,7 @@ An std::pair with (0, 0), if the element is not present. </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">
|
||||
@@ -327,7 +327,7 @@ An std::pair with (0, 0), if the element is not present. </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="../../d3/d22/saddleback__search_8cpp.html">saddleback_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>
|
||||
|
||||
2
d3/d22/saddleback__search_8cpp.js
vendored
@@ -1,6 +1,6 @@
|
||||
var saddleback__search_8cpp =
|
||||
[
|
||||
[ "main", "d3/d22/saddleback__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "saddleback", "d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6", null ],
|
||||
[ "search::saddleback::saddleback", "d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6", null ],
|
||||
[ "test", "d3/d22/saddleback__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: search/saddleback_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&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,12 @@ $(function(){initNavTree('d3/d22/saddleback__search_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">saddleback_search.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d22/saddleback__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="../../d3/d22/saddleback__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="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <vector></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="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d9/dca/namespacesearch.html">search</a> {</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/dda/namespacesaddleback.html">saddleback</a> {</div>
|
||||
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
|
||||
@@ -168,7 +168,7 @@ $(function(){initNavTree('d3/d22/saddleback__search_8cpp_source.html','../../');
|
||||
</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>} <span class="comment">// namespace saddleback</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span>} <span class="comment">// namespace search</span></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="foldopen00078" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="../../d3/d22/saddleback__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 78</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::vector<std::vector<int32_t>> <a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a> = {{1, 10, 100, 1000, 10000},</div>
|
||||
@@ -181,26 +181,26 @@ $(function(){initNavTree('d3/d22/saddleback__search_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::pair<uint32_t, uint32_t> test_answer;</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> std::pair<uint32_t, uint32_t> answer1 =</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> search::saddleback::saddleback(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 123);</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 123);</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> assert(not_found == answer1);</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> answer1 = search::saddleback::saddleback(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 0);</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> answer1 = <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 0);</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> assert(not_found == answer1);</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// Test 3</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> answer1 = search::saddleback::saddleback(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 1);</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> answer1 = <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 1);</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> test_answer = std::make_pair(1, 1);</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="comment">// Test 4</span></div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> answer1 = search::saddleback::saddleback(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 50000);</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> answer1 = <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 50000);</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> test_answer = std::make_pair(5, 5);</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// Test 5</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> answer1 = search::saddleback::saddleback(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 300);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> answer1 = <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a>(<a class="code hl_typedef" href="../../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4">matrix</a>, 300);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> test_answer = std::make_pair(3, 3);</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> assert(test_answer == answer1);</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>}</div>
|
||||
</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="foldopen00112" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="../../d3/d22/saddleback__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 112</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_function" href="../../d3/d22/saddleback__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// execute the tests</span></div>
|
||||
@@ -211,6 +211,7 @@ $(function(){initNavTree('d3/d22/saddleback__search_8cpp_source.html','../../');
|
||||
<div class="ttc" id="anamespacesaddleback_html"><div class="ttname"><a href="../../d0/dda/namespacesaddleback.html">saddleback</a></div><div class="ttdoc">Function for implementing Saddleback Algorithm.</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 class="ttc" id="asaddleback__search_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d3/d22/saddleback__search_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00078">saddleback_search.cpp:78</a></div></div>
|
||||
<div class="ttc" id="asaddleback__search_8cpp_html_ad1e0ca34797d88490747c08eca70a2e6"><div class="ttname"><a href="../../d3/d22/saddleback__search_8cpp.html#ad1e0ca34797d88490747c08eca70a2e6">search::saddleback::saddleback</a></div><div class="ttdeci">std::pair< uint32_t, uint32_t > saddleback(std::vector< std::vector< int32_t > > matrix, int32_t element)</div><div class="ttdef"><b>Definition</b> <a href="#l00039">saddleback_search.cpp:39</a></div></div>
|
||||
<div class="ttc" id="asaddleback__search_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d22/saddleback__search_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="#l00112">saddleback_search.cpp:112</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
@@ -218,7 +219,7 @@ $(function(){initNavTree('d3/d22/saddleback__search_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_19b2bf9199a15c634a08b1ede1dd896a.html">search</a></li><li class="navelem"><a class="el" href="../../d3/d22/saddleback__search_8cpp.html">saddleback_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>
|
||||
|
||||
@@ -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/qr_decomposition.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -147,6 +147,12 @@ Include dependency graph for qr_decomposition.cpp:</div>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe" id="r_a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
|
||||
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a73ce637634fc49e1d10d190eb388ebf1" id="r_a73ce637634fc49e1d10d190eb388ebf1"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a73ce637634fc49e1d10d190eb388ebf1"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a> (const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)</td></tr>
|
||||
<tr class="separator:a73ce637634fc49e1d10d190eb388ebf1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:adfbdf47277c8cfee229b05b72f1f7834" id="r_adfbdf47277c8cfee229b05b72f1f7834"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:adfbdf47277c8cfee229b05b72f1f7834"><td class="memTemplItemLeft" align="right" valign="top">std::ostream & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#adfbdf47277c8cfee229b05b72f1f7834">operator<<</a> (std::ostream &out, std::valarray< std::valarray< T > > const &v)</td></tr>
|
||||
<tr class="separator:adfbdf47277c8cfee229b05b72f1f7834"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Program to compute the <a href="https://en.wikipedia.org/wiki/QR_decomposition" target="_blank">QR decomposition</a> of a given matrix. </p>
|
||||
@@ -198,7 +204,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 47</span> std::cout << A << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><span class="lineno"> 49</span> clock_t t1 = clock();</div>
|
||||
<div class="line"><span class="lineno"> 50</span> qr_decompose(A, &Q, &R);</div>
|
||||
<div class="line"><span class="lineno"> 50</span> <a class="code hl_function" href="#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a>(A, &Q, &R);</div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="keywordtype">double</span> dtime = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(clock() - t1) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><span class="lineno"> 53</span> std::cout << Q << <span class="stringliteral">"\n"</span>;</div>
|
||||
@@ -207,6 +213,170 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 58</span>}</div>
|
||||
<div class="ttc" id="aqr__decomposition_8cpp_html_a73ce637634fc49e1d10d190eb388ebf1"><div class="ttname"><a href="#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a></div><div class="ttdeci">void qr_decompose(const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d68/qr__decompose_8h_source.html#l00146">qr_decompose.h:146</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="adfbdf47277c8cfee229b05b72f1f7834" name="adfbdf47277c8cfee229b05b72f1f7834"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#adfbdf47277c8cfee229b05b72f1f7834">◆ </a></span>operator<<()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">std::ostream & qr_algorithm::operator<< </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">std::ostream &</td> <td class="paramname"><span class="paramname"><em>out</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">std::valarray< std::valarray< T > > const &</td> <td class="paramname"><span class="paramname"><em>v</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>operator to print a matrix </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d68/qr__decompose_8h_source.html#l00033">33</a> of file <a class="el" href="../../d4/d68/qr__decompose_8h_source.html">qr_decompose.h</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 34</span> {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> <span class="keyword">const</span> <span class="keywordtype">int</span> width = 12;</div>
|
||||
<div class="line"><span class="lineno"> 36</span> <span class="keyword">const</span> <span class="keywordtype">char</span> separator = <span class="charliteral">' '</span>;</div>
|
||||
<div class="line"><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><span class="lineno"> 38</span> out.precision(4);</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> row = 0; row < v.size(); row++) {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> col = 0; col < v[row].size(); col++)</div>
|
||||
<div class="line"><span class="lineno"> 41</span> out << std::right << std::setw(width) << std::setfill(separator)</div>
|
||||
<div class="line"><span class="lineno"> 42</span> << v[row][col];</div>
|
||||
<div class="line"><span class="lineno"> 43</span> out << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 44</span> }</div>
|
||||
<div class="line"><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">return</span> out;</div>
|
||||
<div class="line"><span class="lineno"> 47</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a73ce637634fc49e1d10d190eb388ebf1" name="a73ce637634fc49e1d10d190eb388ebf1"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a73ce637634fc49e1d10d190eb388ebf1">◆ </a></span>qr_decompose()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void qr_algorithm::qr_decompose </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">const std::valarray< std::valarray< T > > &</td> <td class="paramname"><span class="paramname"><em>A</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">std::valarray< std::valarray< T > > *</td> <td class="paramname"><span class="paramname"><em>Q</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">std::valarray< std::valarray< T > > *</td> <td class="paramname"><span class="paramname"><em>R</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Decompose matrix \(A\) using <a href="https://en.wikipedia.org/wiki/QR_decomposition" target="_blank">Gram-Schmidt process</a>.</p>
|
||||
<p class="formulaDsp">
|
||||
\begin{eqnarray*} \text{given that}\quad A &=&
|
||||
*\left[\mathbf{a}_1,\mathbf{a}_2,\ldots,\mathbf{a}_{N-1},\right]\\
|
||||
\text{where}\quad\mathbf{a}_i &=&
|
||||
\left[a_{0i},a_{1i},a_{2i},\ldots,a_{(M-1)i}\right]^T\quad\ldots\mbox{(column
|
||||
vectors)}\\
|
||||
\text{then}\quad\mathbf{u}_i &=& \mathbf{a}_i
|
||||
*-\sum_{j=0}^{i-1}\text{proj}_{\mathbf{u}_j}\mathbf{a}_i\\
|
||||
\mathbf{e}_i &=&\frac{\mathbf{u}_i}{\left|\mathbf{u}_i\right|}\\
|
||||
Q &=& \begin{bmatrix}\mathbf{e}_0 & \mathbf{e}_1 & \mathbf{e}_2 & \dots &
|
||||
\mathbf{e}_{N-1}\end{bmatrix}\\
|
||||
R &=& \begin{bmatrix}\langle\mathbf{e}_0\,,\mathbf{a}_0\rangle &
|
||||
\langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
|
||||
\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots \\
|
||||
0 & \langle\mathbf{e}_1\,,\mathbf{a}_1\rangle &
|
||||
\langle\mathbf{e}_2\,,\mathbf{a}_2\rangle & \dots\\
|
||||
0 & 0 & \langle\mathbf{e}_2\,,\mathbf{a}_2\rangle &
|
||||
\dots\\ \vdots & \vdots & \vdots & \ddots
|
||||
\end{bmatrix}\\
|
||||
\end{eqnarray*}
|
||||
</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">A</td><td>input matrix to decompose </td></tr>
|
||||
<tr><td class="paramname">Q</td><td>output decomposed matrix </td></tr>
|
||||
<tr><td class="paramname">R</td><td>output decomposed matrix </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d4/d68/qr__decompose_8h_source.html#l00146">146</a> of file <a class="el" href="../../d4/d68/qr__decompose_8h_source.html">qr_decompose.h</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 150</span> {</div>
|
||||
<div class="line"><span class="lineno"> 151</span> std::size_t ROWS = A.size(); <span class="comment">// number of rows of A</span></div>
|
||||
<div class="line"><span class="lineno"> 152</span> std::size_t COLUMNS = A[0].size(); <span class="comment">// number of columns of A</span></div>
|
||||
<div class="line"><span class="lineno"> 153</span> std::valarray<T> col_vector(ROWS);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> std::valarray<T> col_vector2(ROWS);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> std::valarray<T> tmp_vector(ROWS);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> </div>
|
||||
<div class="line"><span class="lineno"> 157</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < COLUMNS; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="comment">/* for each column => R is a square matrix of NxN */</span></div>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="keywordtype">int</span> j;</div>
|
||||
<div class="line"><span class="lineno"> 160</span> R[0][i] = 0.; <span class="comment">/* make R upper triangular */</span></div>
|
||||
<div class="line"><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><span class="lineno"> 162</span> <span class="comment">/* get corresponding Q vector */</span></div>
|
||||
<div class="line"><span class="lineno"> 163</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 164</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 165</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 166</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 167</span> <span class="keywordflow">for</span> (j = 0; j < ROWS; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 168</span> tmp_vector[j] = A[j][i]; <span class="comment">/* accumulator for uk */</span></div>
|
||||
<div class="line"><span class="lineno"> 169</span> col_vector[j] = A[j][i];</div>
|
||||
<div class="line"><span class="lineno"> 170</span> }</div>
|
||||
<div class="line"><span class="lineno"> 171</span> <span class="keywordflow">for</span> (j = 0; j < i; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 172</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> < ROWS; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 173</span> col_vector2[<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = Q[0][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>][j];</div>
|
||||
<div class="line"><span class="lineno"> 174</span> }</div>
|
||||
<div class="line"><span class="lineno"> 175</span> col_vector2 = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">vector_proj</a>(col_vector, col_vector2);</div>
|
||||
<div class="line"><span class="lineno"> 176</span> tmp_vector -= col_vector2;</div>
|
||||
<div class="line"><span class="lineno"> 177</span> }</div>
|
||||
<div class="line"><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">mag</a> = <a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f">vector_mag</a>(tmp_vector);</div>
|
||||
<div class="line"><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><span class="lineno"> 181</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 182</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 183</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 184</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">for</span> (j = 0; j < ROWS; j++) Q[0][j][i] = tmp_vector[j] / mag;</div>
|
||||
<div class="line"><span class="lineno"> 186</span> </div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="comment">/* compute upper triangular values of R */</span></div>
|
||||
<div class="line"><span class="lineno"> 188</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 189</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 190</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 191</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 192</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 0; kk < ROWS; kk++) {</div>
|
||||
<div class="line"><span class="lineno"> 193</span> col_vector[kk] = Q[0][kk][i];</div>
|
||||
<div class="line"><span class="lineno"> 194</span> }</div>
|
||||
<div class="line"><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><span class="lineno"> 196</span><span class="preprocessor">#ifdef _OPENMP</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span><span class="comment">// parallelize on threads</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span><span class="preprocessor">#pragma omp for</span></div>
|
||||
<div class="line"><span class="lineno"> 199</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><span class="lineno"> 200</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = i; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> < COLUMNS; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> kk = 0; kk < ROWS; kk++) {</div>
|
||||
<div class="line"><span class="lineno"> 202</span> col_vector2[kk] = A[kk][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>];</div>
|
||||
<div class="line"><span class="lineno"> 203</span> }</div>
|
||||
<div class="line"><span class="lineno"> 204</span> R[0][i][<a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>] = (col_vector * col_vector2).<a class="code hl_function" href="../../d8/d77/namespacemachine__learning.html#a6f1c98c016ad34ff3d9f39372161bd35">sum</a>();</div>
|
||||
<div class="line"><span class="lineno"> 205</span> }</div>
|
||||
<div class="line"><span class="lineno"> 206</span> }</div>
|
||||
<div class="line"><span class="lineno"> 207</span>}</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="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< std::valarray< T > > &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 class="ttc" id="anamespaceqr__algorithm_html_a6d3c7dce1f142141f509d09f6c0e25dc"><div class="ttname"><a href="../../d2/d3b/namespaceqr__algorithm.html#a6d3c7dce1f142141f509d09f6c0e25dc">qr_algorithm::vector_proj</a></div><div class="ttdeci">std::valarray< T > vector_proj(const std::valarray< T > &a, const std::valarray< T > &b)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d68/qr__decompose_8h_source.html#l00104">qr_decompose.h:104</a></div></div>
|
||||
<div class="ttc" id="anamespaceqr__algorithm_html_ad16da2183db22378435042f26af43d5f"><div class="ttname"><a href="../../d2/d3b/namespaceqr__algorithm.html#ad16da2183db22378435042f26af43d5f">qr_algorithm::vector_mag</a></div><div class="ttdeci">double vector_mag(const std::valarray< T > &a)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d68/qr__decompose_8h_source.html#l00092">qr_decompose.h:92</a></div></div>
|
||||
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array< double, 3 > &vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it's direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00083">vector_cross_product.cpp:83</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -216,7 +386,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d3/d24/qr__decomposition_8cpp.html">qr_decomposition.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
4
d3/d24/qr__decomposition_8cpp.js
vendored
@@ -1,4 +1,6 @@
|
||||
var qr__decomposition_8cpp =
|
||||
[
|
||||
[ "main", "d3/d24/qr__decomposition_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe", null ]
|
||||
[ "main", "d3/d24/qr__decomposition_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe", null ],
|
||||
[ "operator<<", "d3/d24/qr__decomposition_8cpp.html#adfbdf47277c8cfee229b05b72f1f7834", null ],
|
||||
[ "qr_decompose", "d3/d24/qr__decomposition_8cpp.html#a73ce637634fc49e1d10d190eb388ebf1", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/qr_decomposition.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d3/d24/qr__decomposition_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">qr_decomposition.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d24/qr__decomposition_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="../../d3/d24/qr__decomposition_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <array></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <cmath></span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <cstdlib></span></div>
|
||||
@@ -135,7 +136,7 @@ $(function(){initNavTree('d3/d24/qr__decomposition_8cpp_source.html','../../');
|
||||
<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><span class="keyword">using </span><a class="code hl_function" href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_algorithm::qr_decompose</a>;</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">using </span>qr_algorithm::operator<<;</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span></div>
|
||||
<div class="foldopen" id="foldopen00023" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="../../d3/d24/qr__decomposition_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe"> 23</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d24/qr__decomposition_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">void</span>) {</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ROWS, COLUMNS;</div>
|
||||
@@ -164,7 +165,7 @@ $(function(){initNavTree('d3/d24/qr__decomposition_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::cout << A << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> clock_t t1 = clock();</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> qr_decompose(A, &Q, &R);</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_function" href="../../d3/d24/qr__decomposition_8cpp.html#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a>(A, &Q, &R);</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">double</span> dtime = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(clock() - t1) / CLOCKS_PER_SEC;</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> std::cout << Q << <span class="stringliteral">"\n"</span>;</div>
|
||||
@@ -176,6 +177,7 @@ $(function(){initNavTree('d3/d24/qr__decomposition_8cpp_source.html','../../');
|
||||
</div>
|
||||
<div class="ttc" id="anamespaceqr__algorithm_html_a73ce637634fc49e1d10d190eb388ebf1"><div class="ttname"><a href="../../d2/d3b/namespaceqr__algorithm.html#a73ce637634fc49e1d10d190eb388ebf1">qr_algorithm::qr_decompose</a></div><div class="ttdeci">void qr_decompose(const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d68/qr__decompose_8h_source.html#l00146">qr_decompose.h:146</a></div></div>
|
||||
<div class="ttc" id="aqr__decompose_8h_html"><div class="ttname"><a href="../../d4/d68/qr__decompose_8h.html">qr_decompose.h</a></div><div class="ttdoc">Library functions to compute QR decomposition of a given matrix.</div></div>
|
||||
<div class="ttc" id="aqr__decomposition_8cpp_html_a73ce637634fc49e1d10d190eb388ebf1"><div class="ttname"><a href="../../d3/d24/qr__decomposition_8cpp.html#a73ce637634fc49e1d10d190eb388ebf1">qr_decompose</a></div><div class="ttdeci">void qr_decompose(const std::valarray< std::valarray< T > > &A, std::valarray< std::valarray< T > > *Q, std::valarray< std::valarray< T > > *R)</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d68/qr__decompose_8h_source.html#l00146">qr_decompose.h:146</a></div></div>
|
||||
<div class="ttc" id="aqr__decomposition_8cpp_html_a840291bc02cba5474a4cb46a9b9566fe"><div class="ttname"><a href="../../d3/d24/qr__decomposition_8cpp.html#a840291bc02cba5474a4cb46a9b9566fe">main</a></div><div class="ttdeci">int main(void)</div><div class="ttdef"><b>Definition</b> <a href="#l00023">qr_decomposition.cpp:23</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
@@ -183,7 +185,7 @@ $(function(){initNavTree('d3/d24/qr__decomposition_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../d3/d24/qr__decomposition_8cpp.html">qr_decomposition.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -143,7 +143,7 @@ $(function(){initNavTree('d2/dc8/classdata__structures_1_1_stack.html','../../')
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/binary_search_tree.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -325,7 +325,7 @@ Variables</h2></td></tr>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 29</span> {</div>
|
||||
<div class="line"><span class="lineno"> 30</span> <span class="keywordflow">if</span> (x < n->val) {</div>
|
||||
<div class="line"><span class="lineno"> 31</span> <span class="keywordflow">if</span> (n->left == NULL) {</div>
|
||||
<div class="line"><span class="lineno"> 32</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <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"> 32</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 33</span> temp->val = x;</div>
|
||||
<div class="line"><span class="lineno"> 34</span> temp->left = NULL;</div>
|
||||
<div class="line"><span class="lineno"> 35</span> temp->right = NULL;</div>
|
||||
@@ -335,7 +335,7 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 39</span> }</div>
|
||||
<div class="line"><span class="lineno"> 40</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">if</span> (n->right == NULL) {</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <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"> 42</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 43</span> temp->val = x;</div>
|
||||
<div class="line"><span class="lineno"> 44</span> temp->left = NULL;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> temp->right = NULL;</div>
|
||||
@@ -345,7 +345,6 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 49</span> }</div>
|
||||
<div class="line"><span class="lineno"> 50</span> }</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 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>
|
||||
@@ -371,7 +370,7 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 127</span> <a class="code hl_class" href="../../db/da9/classqueue.html">queue</a>.rear = 0;</div>
|
||||
<div class="line"><span class="lineno"> 128</span> <span class="keywordtype">int</span> value;</div>
|
||||
<div class="line"><span class="lineno"> 129</span> <span class="keywordtype">int</span> ch;</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *root = <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"> 130</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *root = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 131</span> std::cout << <span class="stringliteral">"\nEnter the value of root node :"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 132</span> std::cin >> value;</div>
|
||||
<div class="line"><span class="lineno"> 133</span> root->val = value;</div>
|
||||
@@ -553,7 +552,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_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../d3/d26/binary__search__tree_8cpp.html">binary_search_tree.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/binary_search_tree.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,19 +124,19 @@ $(function(){initNavTree('d3/d26/binary__search__tree_8cpp_source.html','../../'
|
||||
<div class="headertitle"><div class="title">binary_search_tree.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d26/binary__search__tree_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d3/d26/binary__search__tree_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
||||
<div class="foldopen" id="foldopen00011" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="../../d5/da1/structnode.html"> 11</a></span><span class="keyword">struct </span><a class="code hl_class" href="../../d5/da1/structnode.html">node</a> {</div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="../../d5/da1/structnode.html"> 11</a></span><span class="keyword">struct </span>node {</div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordtype">int</span> val;</div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *left;</div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *right;</div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> node *left;</div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> node *right;</div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="../../dc/db5/struct_queue.html"> 17</a></span><span class="keyword">struct </span><a class="code hl_class" href="../../dc/db5/struct_queue.html">Queue</a> {</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="../../dc/db5/struct_queue.html"> 17</a></span><span class="keyword">struct </span>Queue {</div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *t[100];</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">int</span> front;</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">int</span> rear;</div>
|
||||
@@ -152,7 +152,7 @@ $(function(){initNavTree('d3/d26/binary__search__tree_8cpp_source.html','../../'
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keywordtype">void</span> Insert(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *n, <span class="keywordtype">int</span> x) {</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">if</span> (x < n->val) {</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">if</span> (n->left == NULL) {</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <span class="keyword">new</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> temp->val = x;</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> temp->left = NULL;</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> temp->right = NULL;</div>
|
||||
@@ -162,7 +162,7 @@ $(function(){initNavTree('d3/d26/binary__search__tree_8cpp_source.html','../../'
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> }</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">if</span> (n->right == NULL) {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <span class="keyword">new</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *temp = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> temp->val = x;</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> temp->left = NULL;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> temp->right = NULL;</div>
|
||||
@@ -250,7 +250,7 @@ $(function(){initNavTree('d3/d26/binary__search__tree_8cpp_source.html','../../'
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <a class="code hl_class" href="../../db/da9/classqueue.html">queue</a>.rear = 0;</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordtype">int</span> value;</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keywordtype">int</span> ch;</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *root = <span class="keyword">new</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> *root = <span class="keyword">new</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>;</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::cout << <span class="stringliteral">"\nEnter the value of root node :"</span>;</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> std::cin >> value;</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> root->val = value;</div>
|
||||
@@ -295,7 +295,6 @@ $(function(){initNavTree('d3/d26/binary__search__tree_8cpp_source.html','../../'
|
||||
<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> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</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="aclassqueue_html"><div class="ttname"><a href="../../db/da9/classqueue.html">queue</a></div><div class="ttdef"><b>Definition</b> <a href="../../d7/ded/queue_8hpp_source.html#l00009">queue.hpp:9</a></div></div>
|
||||
<div class="ttc" id="aclassqueue_html_a75e231798bc706b8b0773a07f78713e7"><div class="ttname"><a href="../../db/da9/classqueue.html#a75e231798bc706b8b0773a07f78713e7">queue::front</a></div><div class="ttdeci">value_type front() const</div><div class="ttdef"><b>Definition</b> <a href="../../d7/ded/queue_8hpp_source.html#l00072">queue.hpp:72</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>
|
||||
@@ -307,7 +306,7 @@ $(function(){initNavTree('d3/d26/binary__search__tree_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="../../d3/d26/binary__search__tree_8cpp.html">binary_search_tree.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures::trie_using_hashmap::Trie Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -198,7 +198,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -271,7 +271,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -308,7 +308,7 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 179</span> </div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="keywordflow">return</span> results;</div>
|
||||
<div class="line"><span class="lineno"> 181</span> }</div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1trie__using__hashmap_1_1_trie_html_a7bbe538c8015e8ce158e7ed43f605ebd"><div class="ttname"><a href="#a7bbe538c8015e8ce158e7ed43f605ebd">data_structures::trie_using_hashmap::Trie::get_all_words</a></div><div class="ttdeci">std::vector< std::string > get_all_words(std::vector< std::string > results, const std::shared_ptr< Node > &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="../../d5/d8a/trie__using__hashmap_8cpp_source.html#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="#a7bbe538c8015e8ce158e7ed43f605ebd">data_structures::trie_using_hashmap::Trie::get_all_words</a></div><div class="ttdeci">std::vector< std::string > get_all_words(std::vector< std::string > results, const std::shared_ptr< Node > &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="../../d5/d8a/trie__using__hashmap_8cpp_source.html#l00160">trie_using_hashmap.cpp:160</a></div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node_html_a08212cdc99164b59da91b81f45e2f88e"><div class="ttname"><a href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html#a08212cdc99164b59da91b81f45e2f88e">data_structures::trie_using_hashmap::Trie::Node::children</a></div><div class="ttdeci">std::unordered_map< char16_t, std::shared_ptr< Node > > children</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d8a/trie__using__hashmap_8cpp_source.html#l00046">trie_using_hashmap.cpp:46</a></div></div>
|
||||
<div class="ttc" id="astructdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node_html_a3cdb077745d3dc97212d693132371219"><div class="ttname"><a href="../../d5/d12/structdata__structures_1_1trie__using__hashmap_1_1_trie_1_1_node.html#a3cdb077745d3dc97212d693132371219">data_structures::trie_using_hashmap::Trie::Node::word_end</a></div><div class="ttdeci">bool word_end</div><div class="ttdoc">boolean variable to represent the node end</div><div class="ttdef"><b>Definition</b> <a href="../../d5/d8a/trie__using__hashmap_8cpp_source.html#l00048">trie_using_hashmap.cpp:48</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
@@ -332,7 +332,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -380,7 +380,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -443,7 +443,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -499,7 +499,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -545,7 +545,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -567,7 +567,7 @@ Private Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><b>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="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/wiggle_sort.cpp Pages: 1 -->
|
||||
<svg width="384pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/wiggle_sort.cpp Pages: 1 -->
|
||||
<svg width="384pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: machine_learning::aystar_search::AyStarSearch< Puzzle >::comparison_operator Struct Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -148,7 +148,7 @@ struct machine_learning::aystar_search::AyStarSearch< Puzzle >::comparison
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename Puzzle > </div>
|
||||
template<typename Puzzle> </div>
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
@@ -166,15 +166,16 @@ template<typename Puzzle > </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="../../dd/dec/a__star__search_8cpp_source.html#l00371">371</a> of file <a class="el" href="../../dd/dec/a__star__search_8cpp_source.html">a_star_search.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 372</span> {</div>
|
||||
<div class="line"><span class="lineno"> 373</span> <span class="keywordflow">return</span> *(a->state) < *(b->state);</div>
|
||||
<div class="line"><span class="lineno"> 373</span> <span class="keywordflow">return</span> *(<a class="code hl_class" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">a</a>->state) < *(<a class="code hl_class" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">b</a>->state);</div>
|
||||
<div class="line"><span class="lineno"> 374</span> }</div>
|
||||
<div class="ttc" id="aclassmachine__learning_1_1aystar__search_1_1_ay_star_search_html"><div class="ttname"><a href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">machine_learning::aystar_search::AyStarSearch</a></div><div class="ttdoc">A class defining A* search algorithm. for some initial state and final state.</div><div class="ttdef"><b>Definition</b> <a href="../../dd/dec/a__star__search_8cpp_source.html#l00288">a_star_search.cpp:288</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -187,7 +188,7 @@ template<typename Puzzle > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d8/d77/namespacemachine__learning.html">machine_learning</a></li><li class="navelem"><b>aystar_search</b></li><li class="navelem"><a class="el" href="../../da/d02/classmachine__learning_1_1aystar__search_1_1_ay_star_search.html">AyStarSearch</a></li><li class="navelem"><a class="el" href="../../d3/d2a/structmachine__learning_1_1aystar__search_1_1_ay_star_search_1_1comparison__operator.html">comparison_operator</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/hash_search.cpp Pages: 1 -->
|
||||
<svg width="131pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/hash_search.cpp Pages: 1 -->
|
||||
<svg width="131pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/digit_separation.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -219,7 +219,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">
|
||||
@@ -290,7 +290,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d3/d36/digit__separation_8cpp.html">digit_separation.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: greedy_algorithms/digit_separation.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,21 +124,22 @@ $(function(){initNavTree('d3/d36/digit__separation_8cpp_source.html','../../');
|
||||
<div class="headertitle"><div class="title">digit_separation.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d36/digit__separation_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="../../d3/d36/digit__separation_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 <algorithm></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <cmath></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <cstdint></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <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="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</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="foldopen" id="foldopen00035" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html"> 35</a></span><span class="keyword">class </span><a class="code hl_class" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html">DigitSeparation</a> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html"> 35</a></span><span class="keyword">class </span><a class="code hl_function" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#afd54c969a6c9bab16b4a064fbc8ed40e">DigitSeparation</a> {</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#afd54c969a6c9bab16b4a064fbc8ed40e"> 40</a></span> <a class="code hl_function" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#afd54c969a6c9bab16b4a064fbc8ed40e">DigitSeparation</a>() {}</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="foldopen" id="foldopen00048" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#a34769a780845e9d4279152899bd3bf79"> 48</a></span> std::vector<std::int64_t> <a class="code hl_function" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#a34769a780845e9d4279152899bd3bf79">digitSeparationReverseOrder</a>(</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> std::int64_t largeNumber)<span class="keyword"> const </span>{</div>
|
||||
@@ -154,7 +155,7 @@ $(function(){initNavTree('d3/d36/digit__separation_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span></div>
|
||||
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#a1809ae6828223999374bde5b197a59c8"> 68</a></span> std::vector<std::int64_t> <a class="code hl_function" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html#a1809ae6828223999374bde5b197a59c8">digitSeparationForwardOrder</a>(</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> std::int64_t largeNumber)<span class="keyword"> const </span>{</div>
|
||||
@@ -168,7 +169,7 @@ $(function(){initNavTree('d3/d36/digit__separation_8cpp_source.html','../../');
|
||||
</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>} <span class="comment">// namespace greedy_algorithms</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</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="../../d3/d36/digit__separation_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e"> 83</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d36/digit__separation_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>() {</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_class" href="../../da/d49/classgreedy__algorithms_1_1_digit_separation.html">greedy_algorithms::DigitSeparation</a> ds;</div>
|
||||
@@ -221,7 +222,7 @@ $(function(){initNavTree('d3/d36/digit__separation_8cpp_source.html','../../');
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> assert(forwardOrder == expectedForward);</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="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span></div>
|
||||
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="../../d3/d36/digit__separation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 138</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d36/digit__separation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_function" href="../../d3/d36/digit__separation_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>(); <span class="comment">// run self test implementation</span></div>
|
||||
@@ -242,7 +243,7 @@ $(function(){initNavTree('d3/d36/digit__separation_8cpp_source.html','../../');
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_0eaa691bd54ab0922ca7f50599de6d22.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../d3/d36/digit__separation_8cpp.html">digit_separation.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/check_prime.cpp Pages: 1 -->
|
||||
<svg width="128pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/check_prime.cpp Pages: 1 -->
|
||||
<svg width="128pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/manacher_algorithm.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -345,7 +345,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">
|
||||
@@ -355,21 +355,22 @@ Functions</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/d39/manacher__algorithm_8cpp_source.html#l00151">151</a> of file <a class="el" href="../../d3/d39/manacher__algorithm_8cpp_source.html">manacher_algorithm.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 151</span> {</div>
|
||||
<div class="line"><span class="lineno"> 152</span> assert(strings::manacher::manacher(<span class="stringliteral">""</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><span class="lineno"> 153</span> assert(strings::manacher::manacher(<span class="stringliteral">"abababc"</span>) == <span class="stringliteral">"ababa"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> assert(strings::manacher::manacher(<span class="stringliteral">"cbaabd"</span>) == <span class="stringliteral">"baab"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> assert(strings::manacher::manacher(<span class="stringliteral">"DedzefDeD"</span>) == <span class="stringliteral">"DeD"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> assert(strings::manacher::manacher(<span class="stringliteral">"XZYYXXYZXX"</span>) == <span class="stringliteral">"YXXY"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> assert(strings::manacher::manacher(<span class="stringliteral">"1sm222m10abc"</span>) == <span class="stringliteral">"m222m"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> assert(strings::manacher::manacher(<span class="stringliteral">"798989591"</span>) == <span class="stringliteral">"98989"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> assert(strings::manacher::manacher(<span class="stringliteral">"xacdedcax"</span>) == <span class="stringliteral">"xacdedcax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> assert(strings::manacher::manacher(<span class="stringliteral">"xaccax"</span>) == <span class="stringliteral">"xaccax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 161</span> assert(strings::manacher::manacher(<span class="stringliteral">"a"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(strings::manacher::manacher(<span class="stringliteral">"xy"</span>) == <span class="stringliteral">"x"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> assert(strings::manacher::manacher(<span class="stringliteral">"abced"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 152</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">""</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><span class="lineno"> 153</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"abababc"</span>) == <span class="stringliteral">"ababa"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"cbaabd"</span>) == <span class="stringliteral">"baab"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"DedzefDeD"</span>) == <span class="stringliteral">"DeD"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"XZYYXXYZXX"</span>) == <span class="stringliteral">"YXXY"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"1sm222m10abc"</span>) == <span class="stringliteral">"m222m"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"798989591"</span>) == <span class="stringliteral">"98989"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"xacdedcax"</span>) == <span class="stringliteral">"xacdedcax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"xaccax"</span>) == <span class="stringliteral">"xaccax"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 161</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"a"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"xy"</span>) == <span class="stringliteral">"x"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 163</span> assert(<a class="code hl_function" href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"abced"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><span class="lineno"> 164</span> </div>
|
||||
<div class="line"><span class="lineno"> 165</span> std::cout << <span class="stringliteral">"All tests have passed!"</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 166</span>}</div>
|
||||
<div class="ttc" id="amanacher__algorithm_8cpp_html_a95e6a2976bb2f332898f373941d52098"><div class="ttname"><a href="#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a></div><div class="ttdeci">std::string manacher(const std::string &prototype)</div><div class="ttdoc">A function that implements Manacher's algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d39/manacher__algorithm_8cpp_source.html#l00041">manacher_algorithm.cpp:41</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -379,7 +380,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_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d39/manacher__algorithm_8cpp.html">manacher_algorithm.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
2
d3/d39/manacher__algorithm_8cpp.js
vendored
@@ -1,6 +1,6 @@
|
||||
var manacher__algorithm_8cpp =
|
||||
[
|
||||
[ "main", "d3/d39/manacher__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "manacher", "d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098", null ],
|
||||
[ "strings::manacher::manacher", "d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098", null ],
|
||||
[ "test", "d3/d39/manacher__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/manacher_algorithm.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d3/d39/manacher__algorithm_8cpp_source.html','../../')
|
||||
<div class="headertitle"><div class="title">manacher_algorithm.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d39/manacher__algorithm_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="../../d3/d39/manacher__algorithm_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
@@ -134,7 +135,7 @@ $(function(){initNavTree('d3/d39/manacher__algorithm_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <cstring></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#endif</span></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="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/dcb/namespacestrings.html">strings</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d8/dc6/namespacemanacher.html">manacher</a> {</div>
|
||||
<div class="foldopen" id="foldopen00041" data-start="{" data-end="}">
|
||||
@@ -244,35 +245,36 @@ $(function(){initNavTree('d3/d39/manacher__algorithm_8cpp_source.html','../../')
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span>} <span class="comment">// namespace manacher</span></div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span>} <span class="comment">// namespace strings</span></div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> </div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span></div>
|
||||
<div class="foldopen" id="foldopen00151" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="../../d3/d39/manacher__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 151</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> assert(strings::manacher::manacher(<span class="stringliteral">""</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> assert(strings::manacher::manacher(<span class="stringliteral">"abababc"</span>) == <span class="stringliteral">"ababa"</span>);</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> assert(strings::manacher::manacher(<span class="stringliteral">"cbaabd"</span>) == <span class="stringliteral">"baab"</span>);</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> assert(strings::manacher::manacher(<span class="stringliteral">"DedzefDeD"</span>) == <span class="stringliteral">"DeD"</span>);</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> assert(strings::manacher::manacher(<span class="stringliteral">"XZYYXXYZXX"</span>) == <span class="stringliteral">"YXXY"</span>);</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> assert(strings::manacher::manacher(<span class="stringliteral">"1sm222m10abc"</span>) == <span class="stringliteral">"m222m"</span>);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> assert(strings::manacher::manacher(<span class="stringliteral">"798989591"</span>) == <span class="stringliteral">"98989"</span>);</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> assert(strings::manacher::manacher(<span class="stringliteral">"xacdedcax"</span>) == <span class="stringliteral">"xacdedcax"</span>);</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> assert(strings::manacher::manacher(<span class="stringliteral">"xaccax"</span>) == <span class="stringliteral">"xaccax"</span>);</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> assert(strings::manacher::manacher(<span class="stringliteral">"a"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> assert(strings::manacher::manacher(<span class="stringliteral">"xy"</span>) == <span class="stringliteral">"x"</span>);</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> assert(strings::manacher::manacher(<span class="stringliteral">"abced"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">""</span>) == <span class="stringliteral">""</span>);</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"abababc"</span>) == <span class="stringliteral">"ababa"</span>);</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"cbaabd"</span>) == <span class="stringliteral">"baab"</span>);</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"DedzefDeD"</span>) == <span class="stringliteral">"DeD"</span>);</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"XZYYXXYZXX"</span>) == <span class="stringliteral">"YXXY"</span>);</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"1sm222m10abc"</span>) == <span class="stringliteral">"m222m"</span>);</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"798989591"</span>) == <span class="stringliteral">"98989"</span>);</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"xacdedcax"</span>) == <span class="stringliteral">"xacdedcax"</span>);</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"xaccax"</span>) == <span class="stringliteral">"xaccax"</span>);</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"a"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"xy"</span>) == <span class="stringliteral">"x"</span>);</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> assert(<a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a>(<span class="stringliteral">"abced"</span>) == <span class="stringliteral">"a"</span>);</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> std::cout << <span class="stringliteral">"All tests have passed!"</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span></div>
|
||||
<div class="foldopen" id="foldopen00172" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"><a class="line" href="../../d3/d39/manacher__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 172</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <a class="code hl_function" href="../../d3/d39/manacher__algorithm_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="amanacher__algorithm_8cpp_html_a95e6a2976bb2f332898f373941d52098"><div class="ttname"><a href="../../d3/d39/manacher__algorithm_8cpp.html#a95e6a2976bb2f332898f373941d52098">strings::manacher::manacher</a></div><div class="ttdeci">std::string manacher(const std::string &prototype)</div><div class="ttdoc">A function that implements Manacher's algorithm.</div><div class="ttdef"><b>Definition</b> <a href="#l00041">manacher_algorithm.cpp:41</a></div></div>
|
||||
<div class="ttc" id="amanacher__algorithm_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d3/d39/manacher__algorithm_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="#l00151">manacher_algorithm.cpp:151</a></div></div>
|
||||
<div class="ttc" id="amanacher__algorithm_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d39/manacher__algorithm_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="#l00172">manacher_algorithm.cpp:172</a></div></div>
|
||||
<div class="ttc" id="anamespacemanacher_html"><div class="ttname"><a href="../../d8/dc6/namespacemanacher.html">manacher</a></div><div class="ttdoc">Functions for Manacher's Algorithm implementation.</div></div>
|
||||
<div class="ttc" id="anamespacemanacher_html"><div class="ttname"><a href="../../d8/dc6/namespacemanacher.html">manacher</a></div><div class="ttdoc">Functions for Manacher's Algorithm implementation.</div></div>
|
||||
<div class="ttc" id="anamespacestrings_html"><div class="ttname"><a href="../../df/dcb/namespacestrings.html">strings</a></div><div class="ttdoc">String algorithms.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00058">boyer_moore.cpp:58</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
@@ -280,7 +282,7 @@ $(function(){initNavTree('d3/d39/manacher__algorithm_8cpp_source.html','../../')
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d39/manacher__algorithm_8cpp.html">manacher_algorithm.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/complex_numbers.cpp Pages: 1 -->
|
||||
<svg width="395pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: math/complex_numbers.cpp Pages: 1 -->
|
||||
<svg width="395pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: backtracking/graph_coloring.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -230,7 +230,7 @@ template<size_t V> </div>
|
||||
<div class="line"><span class="lineno"> 84</span> <span class="comment">// base case:</span></div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="comment">// If all vertices are assigned a color then return true</span></div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span> (v == V) {</div>
|
||||
<div class="line"><span class="lineno"> 87</span> printSolution<V>(color);</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <a class="code hl_function" href="#a8c47fa37fb6eeeb781b2ec1b05af6b07">printSolution<V></a>(color);</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><span class="lineno"> 90</span> </div>
|
||||
@@ -248,6 +248,7 @@ template<size_t V> </div>
|
||||
<div class="line"><span class="lineno"> 102</span> }</div>
|
||||
<div class="line"><span class="lineno"> 103</span> }</div>
|
||||
<div class="line"><span class="lineno"> 104</span>}</div>
|
||||
<div class="ttc" id="agraph__coloring_8cpp_html_a8c47fa37fb6eeeb781b2ec1b05af6b07"><div class="ttname"><a href="#a8c47fa37fb6eeeb781b2ec1b05af6b07">backtracking::graph_coloring::printSolution</a></div><div class="ttdeci">void printSolution(const std::array< int, V > &color)</div><div class="ttdoc">A utility function to print the solution.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d40/graph__coloring_8cpp_source.html#l00042">graph_coloring.cpp:42</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -350,9 +351,10 @@ template<size_t V> </div>
|
||||
<div class="line"><span class="lineno"> 125</span> <span class="keywordtype">int</span> m = 3; <span class="comment">// Number of colors</span></div>
|
||||
<div class="line"><span class="lineno"> 126</span> std::array<int, V> color{};</div>
|
||||
<div class="line"><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><span class="lineno"> 128</span> backtracking::graph_coloring::graphColoring<V>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, m, color, 0);</div>
|
||||
<div class="line"><span class="lineno"> 128</span> <a class="code hl_function" href="#a40337efc5dad761096489bf2c5b1c80c">backtracking::graph_coloring::graphColoring<V></a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, m, color, 0);</div>
|
||||
<div class="line"><span class="lineno"> 129</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 130</span>}</div>
|
||||
<div class="ttc" id="agraph__coloring_8cpp_html_a40337efc5dad761096489bf2c5b1c80c"><div class="ttname"><a href="#a40337efc5dad761096489bf2c5b1c80c">backtracking::graph_coloring::graphColoring</a></div><div class="ttdeci">void graphColoring(const std::array< std::array< int, V >, V > &graph, int m, std::array< int, V > color, int v)</div><div class="ttdoc">Recursive utility function to solve m coloring problem.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d40/graph__coloring_8cpp_source.html#l00082">graph_coloring.cpp:82</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -404,7 +406,7 @@ template<size_t V> </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d3/d40/graph__coloring_8cpp.html">graph_coloring.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>
|
||||
|
||||
6
d3/d40/graph__coloring_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var graph__coloring_8cpp =
|
||||
[
|
||||
[ "graphColoring", "d3/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c", null ],
|
||||
[ "isSafe", "d3/d40/graph__coloring_8cpp.html#a976efe049deb042bf1f02612e181ab1d", null ],
|
||||
[ "backtracking::graph_coloring::graphColoring", "d3/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c", null ],
|
||||
[ "backtracking::graph_coloring::isSafe", "d3/d40/graph__coloring_8cpp.html#a976efe049deb042bf1f02612e181ab1d", null ],
|
||||
[ "main", "d3/d40/graph__coloring_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "printSolution", "d3/d40/graph__coloring_8cpp.html#a8c47fa37fb6eeeb781b2ec1b05af6b07", null ]
|
||||
[ "backtracking::graph_coloring::printSolution", "d3/d40/graph__coloring_8cpp.html#a8c47fa37fb6eeeb781b2ec1b05af6b07", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: backtracking/graph_coloring.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,11 +124,12 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
|
||||
<div class="headertitle"><div class="title">graph_coloring.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d40/graph__coloring_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="../../d3/d40/graph__coloring_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <array></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <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="../../db/dc0/namespacebacktracking.html">backtracking</a> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d08/namespacegraph__coloring.html">graph_coloring</a> {</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> V></div>
|
||||
@@ -141,7 +142,7 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> std::cout << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span>}</div>
|
||||
</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="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> V></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/d40/graph__coloring_8cpp.html#a976efe049deb042bf1f02612e181ab1d"> 62</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#a976efe049deb042bf1f02612e181ab1d">isSafe</a>(<span class="keywordtype">int</span> v, <span class="keyword">const</span> std::array<std::array<int, V>, V>& <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>,</div>
|
||||
@@ -154,7 +155,7 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>}</div>
|
||||
</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="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="keyword">template</span> <<span class="keywordtype">size_t</span> V></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/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c"> 82</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c">graphColoring</a>(<span class="keyword">const</span> std::array<std::array<int, V>, V>& <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, <span class="keywordtype">int</span> m,</div>
|
||||
@@ -162,18 +163,18 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// base case:</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// If all vertices are assigned a color then return true</span></div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">if</span> (v == V) {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> printSolution<V>(color);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#a8c47fa37fb6eeeb781b2ec1b05af6b07">printSolution<V></a>(color);</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">return</span>;</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>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// Consider this vertex v and try different colors</span></div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> c = 1; c <= m; c++) {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// Check if assignment of color c to v is fine</span></div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">if</span> (isSafe<V>(v, <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, color, c)) {</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#a976efe049deb042bf1f02612e181ab1d">isSafe<V></a>(v, <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, color, c)) {</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> color[v] = c;</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// recur to assign colors to rest of the vertices</span></div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> graphColoring<V>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, m, color, v + 1);</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c">graphColoring<V></a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, m, color, v + 1);</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="comment">// If assigning color c doesn't lead to a solution then remove it</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> color[v] = 0;</div>
|
||||
@@ -183,7 +184,7 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
|
||||
</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>} <span class="comment">// namespace graph_coloring</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>} <span class="comment">// namespace backtracking</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="foldopen00112" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="../../d3/d40/graph__coloring_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 112</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// Create following graph and test whether it is 3 colorable</span></div>
|
||||
@@ -201,7 +202,7 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">int</span> m = 3; <span class="comment">// Number of colors</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> std::array<int, V> color{};</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> backtracking::graph_coloring::graphColoring<V>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, m, color, 0);</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <a class="code hl_function" href="../../d3/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c">backtracking::graph_coloring::graphColoring<V></a>(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>, m, color, 0);</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span>}</div>
|
||||
</div>
|
||||
@@ -218,7 +219,7 @@ $(function(){initNavTree('d3/d40/graph__coloring_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_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d3/d40/graph__coloring_8cpp.html">graph_coloring.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/quick_sort_3.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -151,10 +151,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:a9f59fe72dacc1f1218ef3c303d843168" id="r_a9f59fe72dacc1f1218ef3c303d843168"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a9f59fe72dacc1f1218ef3c303d843168" id="r_a9f59fe72dacc1f1218ef3c303d843168"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a9f59fe72dacc1f1218ef3c303d843168"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d5/d91/namespacesorting.html#a9f59fe72dacc1f1218ef3c303d843168">sorting::quicksort</a> (std::vector< T > *arr, int32_t low, int32_t high)</td></tr>
|
||||
<tr class="separator:a9f59fe72dacc1f1218ef3c303d843168"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6eb67c2f91c98cf4464f75b5882022de" id="r_a6eb67c2f91c98cf4464f75b5882022de"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a6eb67c2f91c98cf4464f75b5882022de" id="r_a6eb67c2f91c98cf4464f75b5882022de"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a6eb67c2f91c98cf4464f75b5882022de"><td class="memTemplItemLeft" align="right" valign="top">std::vector< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d5/d91/namespacesorting.html#a6eb67c2f91c98cf4464f75b5882022de">sorting::quicksort</a> (std::vector< T > arr, int32_t low, int32_t high)</td></tr>
|
||||
<tr class="separator:a6eb67c2f91c98cf4464f75b5882022de"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a07e5c62de28aeddea986890ce7ac1bda" id="r_a07e5c62de28aeddea986890ce7ac1bda"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a07e5c62de28aeddea986890ce7ac1bda">test_int</a> ()</td></tr>
|
||||
@@ -218,7 +218,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -269,7 +269,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">
|
||||
@@ -305,7 +305,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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d3/d4c/quick__sort__3_8cpp.html">quick_sort_3.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
4
d3/d4c/quick__sort__3_8cpp.js
vendored
@@ -1,8 +1,8 @@
|
||||
var quick__sort__3_8cpp =
|
||||
[
|
||||
[ "main", "d3/d4c/quick__sort__3_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "quicksort", "d3/d4c/quick__sort__3_8cpp.html#a9f59fe72dacc1f1218ef3c303d843168", null ],
|
||||
[ "quicksort", "d3/d4c/quick__sort__3_8cpp.html#a6eb67c2f91c98cf4464f75b5882022de", null ],
|
||||
[ "sorting::quicksort", "d5/d91/namespacesorting.html#a9f59fe72dacc1f1218ef3c303d843168", null ],
|
||||
[ "sorting::quicksort", "d5/d91/namespacesorting.html#a6eb67c2f91c98cf4464f75b5882022de", null ],
|
||||
[ "test_double", "d3/d4c/quick__sort__3_8cpp.html#a2635b04ad943fa28b7bbf8d1e6479792", null ],
|
||||
[ "test_int", "d3/d4c/quick__sort__3_8cpp.html#a07e5c62de28aeddea986890ce7ac1bda", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/quick_sort_3.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">quick_sort_3.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d4c/quick__sort__3_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="../../d3/d4c/quick__sort__3_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <ctime></span></div>
|
||||
@@ -144,7 +144,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>}</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span>} <span class="comment">// namespace</span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d91/namespacesorting.html">sorting</a> {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">namespace </span>{ <span class="comment">// using un-named namespace here to prevent partition function</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// being visible to end-users</span></div>
|
||||
@@ -178,7 +178,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> *j = mid; <span class="comment">// or high-1</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span>}</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>} <span class="comment">// namespace</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span></div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="../../d5/d91/namespacesorting.html#a9f59fe72dacc1f1218ef3c303d843168"> 94</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(std::vector<T> *arr, int32_t low, int32_t high) {</div>
|
||||
@@ -196,7 +196,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(arr, j, high);</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></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="../../d5/d91/namespacesorting.html#a6eb67c2f91c98cf4464f75b5882022de"> 119</a></span>std::vector<T> <a class="code hl_function" href="../../d5/d91/namespacesorting.html#a9f59fe72dacc1f1218ef3c303d843168">quicksort</a>(std::vector<T> arr, int32_t low, int32_t high) {</div>
|
||||
@@ -217,7 +217,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span>} <span class="comment">// namespace sorting</span></div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span></div>
|
||||
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="../../d3/d4c/quick__sort__3_8cpp.html#a07e5c62de28aeddea986890ce7ac1bda"> 138</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d4c/quick__sort__3_8cpp.html#a07e5c62de28aeddea986890ce7ac1bda">test_int</a>() {</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> std::cout << <span class="stringliteral">"\nTesting integer type arrays\n"</span>;</div>
|
||||
@@ -240,7 +240,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</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/d4c/quick__sort__3_8cpp.html#a2635b04ad943fa28b7bbf8d1e6479792"> 160</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d4c/quick__sort__3_8cpp.html#a2635b04ad943fa28b7bbf8d1e6479792">test_double</a>() {</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> std::cout << <span class="stringliteral">"\nTesting Double type arrays\n"</span>;</div>
|
||||
@@ -265,7 +265,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> }</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="foldopen00184" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"><a class="line" href="../../d3/d4c/quick__sort__3_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 184</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d4c/quick__sort__3_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> std::srand(std::time(<span class="keyword">nullptr</span>));</div>
|
||||
@@ -286,7 +286,7 @@ $(function(){initNavTree('d3/d4c/quick__sort__3_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_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d3/d4c/quick__sort__3_8cpp.html">quick_sort_3.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: hashing/sha1.cpp Pages: 1 -->
|
||||
<!--zoomable 83 -->
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: hashing/sha1.cpp Pages: 1 -->
|
||||
<svg width="503pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers/xor_cipher.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -329,7 +329,7 @@ Algorithm</h3>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../d3/d4c/xor__cipher_8cpp.html">xor_cipher.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
4
d3/d4c/xor__cipher_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var xor__cipher_8cpp =
|
||||
[
|
||||
[ "decrypt", "d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4", null ],
|
||||
[ "encrypt", "d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef", null ],
|
||||
[ "ciphers::XOR::decrypt", "d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4", null ],
|
||||
[ "ciphers::XOR::encrypt", "d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef", null ],
|
||||
[ "main", "d3/d4c/xor__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d3/d4c/xor__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers/xor_cipher.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,15 +124,15 @@ $(function(){initNavTree('d3/d4c/xor__cipher_8cpp_source.html','../../'); initRe
|
||||
<div class="headertitle"><div class="title">xor_cipher.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d4c/xor__cipher_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d3/d4c/xor__cipher_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#include <string></span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include <cassert></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="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d4e/namespaceciphers.html">ciphers</a> {</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">namespace </span><a class="code hl_namespace" href="../../d7/d47/namespace_x_o_r.html">XOR</a> { </div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef"> 47</a></span> std::string encrypt (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &key) {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef"> 47</a></span> std::string <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef">encrypt</a> (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &key) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::string encrypted_text = <span class="stringliteral">""</span>; <span class="comment">// Empty string to store encrypted text</span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> &c: text) { <span class="comment">// Going through each character</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">char</span> encrypted_char = char(c ^ key); <span class="comment">// Applying encyption</span></div>
|
||||
@@ -141,8 +141,9 @@ $(function(){initNavTree('d3/d4c/xor__cipher_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> encrypted_text; <span class="comment">// Returning encrypted text</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||
<div class="foldopen" id="foldopen00061" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4"> 61</a></span> std::string decrypt (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &key) {</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4"> 61</a></span> std::string <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4">decrypt</a> (<span class="keyword">const</span> std::string &text, <span class="keyword">const</span> <span class="keywordtype">int</span> &key) {</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> std::string decrypted_text = <span class="stringliteral">""</span>; <span class="comment">// Empty string to store decrypted text</span></div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> &c : text) { <span class="comment">// Going through each character</span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">char</span> decrypted_char = char(c ^ key); <span class="comment">// Applying decryption</span></div>
|
||||
@@ -153,28 +154,28 @@ $(function(){initNavTree('d3/d4c/xor__cipher_8cpp_source.html','../../'); initRe
|
||||
</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> } <span class="comment">// namespace XOR</span></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>} <span class="comment">// namespace ciphers</span></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="foldopen00075" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../d3/d4c/xor__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002"> 75</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a>() {</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// Test 1</span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> std::string text1 = <span class="stringliteral">"Whipalsh! : Do watch this movie..."</span>;</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::string encrypted1 = ciphers::XOR::encrypt(text1, 17);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::string decrypted1 = ciphers::XOR::decrypt(encrypted1, 17);</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> std::string encrypted1 = <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef">ciphers::XOR::encrypt</a>(text1, 17);</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> std::string decrypted1 = <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4">ciphers::XOR::decrypt</a>(encrypted1, 17);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> assert(text1 == decrypted1);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> std::cout << <span class="stringliteral">"Original text : "</span> << text1;</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> std::cout << <span class="stringliteral">" , Encrypted text (with key = 17) : "</span> << encrypted1;</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> std::cout << <span class="stringliteral">" , Decrypted text : "</span><< decrypted1 << std::endl;</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// Test 2</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::string text2 = <span class="stringliteral">"->Valar M0rghulis<-"</span>;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::string encrypted2 = ciphers::XOR::encrypt(text2, 29);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> std::string decrypted2 = ciphers::XOR::decrypt(encrypted2, 29);</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> std::string encrypted2 = <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef">ciphers::XOR::encrypt</a>(text2, 29);</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> std::string decrypted2 = <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4">ciphers::XOR::decrypt</a>(encrypted2, 29);</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> assert(text2 == decrypted2);</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::cout << <span class="stringliteral">"Original text : "</span> << text2;</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> std::cout << <span class="stringliteral">" , Encrypted text (with key = 29) : "</span> << encrypted2;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::cout << <span class="stringliteral">" , Decrypted text : "</span><< decrypted2 << std::endl;</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span>}</div>
|
||||
</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="foldopen00095" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="../../d3/d4c/xor__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 95</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d4c/xor__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// Testing</span></div>
|
||||
@@ -184,15 +185,17 @@ $(function(){initNavTree('d3/d4c/xor__cipher_8cpp_source.html','../../'); initRe
|
||||
</div>
|
||||
<div class="ttc" id="anamespace_x_o_r_html"><div class="ttname"><a href="../../d7/d47/namespace_x_o_r.html">XOR</a></div><div class="ttdoc">Functions for XOR cipher algorithm.</div></div>
|
||||
<div class="ttc" id="anamespaceciphers_html"><div class="ttname"><a href="../../d6/d4e/namespaceciphers.html">ciphers</a></div><div class="ttdoc">Algorithms for encryption and decryption.</div></div>
|
||||
<div class="ttc" id="axor__cipher_8cpp_html_a6099b7e0f1793f418d2c1befca8355a4"><div class="ttname"><a href="../../d3/d4c/xor__cipher_8cpp.html#a6099b7e0f1793f418d2c1befca8355a4">ciphers::XOR::decrypt</a></div><div class="ttdeci">std::string decrypt(const std::string &text, const int &key)</div><div class="ttdef"><b>Definition</b> <a href="#l00061">xor_cipher.cpp:61</a></div></div>
|
||||
<div class="ttc" id="axor__cipher_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="../../d3/d4c/xor__cipher_8cpp.html#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="#l00075">xor_cipher.cpp:75</a></div></div>
|
||||
<div class="ttc" id="axor__cipher_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d4c/xor__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00095">xor_cipher.cpp:95</a></div></div>
|
||||
<div class="ttc" id="axor__cipher_8cpp_html_aeff72a463ffc580c16cc849cbbdc58ef"><div class="ttname"><a href="../../d3/d4c/xor__cipher_8cpp.html#aeff72a463ffc580c16cc849cbbdc58ef">ciphers::XOR::encrypt</a></div><div class="ttdeci">std::string encrypt(const std::string &text, const int &key)</div><div class="ttdef"><b>Definition</b> <a href="#l00047">xor_cipher.cpp:47</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../d3/d4c/xor__cipher_8cpp.html">xor_cipher.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: range_queries/mo.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -129,8 +129,8 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">using namespace </span>std;</div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</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> = 1e6 + 5;</div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keywordtype">int</span> a[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>], bucket[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>], cnt[<a class="code hl_variable" href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">N</a>];</div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="keyword">const</span> <span class="keywordtype">int</span> N = 1e6 + 5;</div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keywordtype">int</span> a[N], bucket[N], cnt[N];</div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keywordtype">int</span> bucket_size;</div>
|
||||
<div class="foldopen" id="foldopen00009" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="../../dd/d1b/structquery.html"> 9</a></span><span class="keyword">struct </span><a class="code hl_struct" href="../../dd/d1b/structquery.html">query</a> {</div>
|
||||
@@ -144,7 +144,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordflow">if</span> (cnt[a[index]] == 1)</div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> ans++;</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="keywordtype">void</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(<span class="keywordtype">int</span> index) {</div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keywordtype">void</span> remove(<span class="keywordtype">int</span> index) {</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> cnt[a[index]]--;</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> (cnt[a[index]] == 0)</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> ans--;</div>
|
||||
@@ -173,7 +173,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">for</span> (i = 0; i < t; i++) {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">int</span> L = q[i].l, R = q[i].r;</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">while</span> (left < L) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(left);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> remove(left);</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> left++;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">while</span> (left > L) {</div>
|
||||
@@ -185,7 +185,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> right++;</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">while</span> (right > R + 1) {</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_function" href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">remove</a>(right - 1);</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> remove(right - 1);</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> right--;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> bucket[q[i].i] = ans;</div>
|
||||
@@ -195,8 +195,6 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</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="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="anamespacedouble__hashing_html_a28083ecac6eb94b643281875c8665931"><div class="ttname"><a href="../../d0/d65/namespacedouble__hashing.html#a28083ecac6eb94b643281875c8665931">double_hashing::remove</a></div><div class="ttdeci">void remove(int key)</div><div class="ttdef"><b>Definition</b> <a href="../../d6/d80/double__hash__hash__table_8cpp_source.html#l00199">double_hash_hash_table.cpp:199</a></div></div>
|
||||
<div class="ttc" id="asparse__table_8cpp_html_a10f3ffb3f6f7e1b83d556b9c8de89a5d"><div class="ttname"><a href="../../d8/dab/sparse__table_8cpp.html#a10f3ffb3f6f7e1b83d556b9c8de89a5d">data_structures::sparse_table::N</a></div><div class="ttdeci">constexpr uint32_t N</div><div class="ttdoc">A struct to represent sparse table for min() as their invariant function, for the given array A....</div><div class="ttdef"><b>Definition</b> <a href="../../d8/dab/sparse__table_8cpp_source.html#l00048">sparse_table.cpp:48</a></div></div>
|
||||
<div class="ttc" id="astructquery_html"><div class="ttname"><a href="../../dd/d1b/structquery.html">query</a></div><div class="ttdef"><b>Definition</b> <a href="#l00009">mo.cpp:9</a></div></div>
|
||||
<div class="ttc" id="auint128__t_8hpp_html_a3ff77262ffd6743df5b808d41382a6f3"><div class="ttname"><a href="../../da/d41/uint128__t_8hpp.html#a3ff77262ffd6743df5b808d41382a6f3">add</a></div><div class="ttdeci">std::string add(const std::string &first, const std::string &second)</div><div class="ttdoc">Adding two string.</div><div class="ttdef"><b>Definition</b> <a href="../../da/d41/uint128__t_8hpp_source.html#l00038">uint128_t.hpp:38</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -205,7 +203,7 @@ $(function(){initNavTree('d3/d53/mo_8cpp_source.html','../../'); initResizable(t
|
||||
<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"><b>mo.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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: probability/binomial_dist.cpp Pages: 1 -->
|
||||
<svg width="122pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: probability/binomial_dist.cpp Pages: 1 -->
|
||||
<svg width="122pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/vector_important_functions.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -210,7 +210,7 @@ Functions</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d3/d61/vector__important__functions_8cpp.html">vector_important_functions.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: others/vector_important_functions.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,12 @@ $(function(){initNavTree('d3/d61/vector__important__functions_8cpp_source.html',
|
||||
<div class="headertitle"><div class="title">vector_important_functions.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d61/vector__important__functions_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="../../d3/d61/vector__important__functions_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <numeric></span> <span class="comment">// For accumulate operation</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span></div>
|
||||
<div class="foldopen" id="foldopen00011" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="../../d3/d61/vector__important__functions_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 11</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d61/vector__important__functions_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// Initializing vector with array values</span></div>
|
||||
@@ -172,7 +172,7 @@ $(function(){initNavTree('d3/d61/vector__important__functions_8cpp_source.html',
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d3/d61/vector__important__functions_8cpp.html">vector_important_functions.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: machine_learning::neural_network::layers::DenseLayer Pages: 1 -->
|
||||
<svg width="238pt" height="194pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: machine_learning::neural_network::layers::DenseLayer Pages: 1 -->
|
||||
<svg width="238pt" height="194pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: linkedlist Pages: 1 -->
|
||||
<svg width="102pt" height="27pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: linkedlist Pages: 1 -->
|
||||
<svg width="102pt" height="27pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
174
d3/d6d/classunordered__set.html
Normal file
@@ -0,0 +1,174 @@
|
||||
<!-- 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++: unordered_set< K > Class Template Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('d3/d6d/classunordered__set.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#nested-classes">Classes</a> |
|
||||
<a href="#pub-attribs">Public Attributes</a> |
|
||||
<a href="../../d7/dac/classunordered__set-members.html">List of all members</a> </div>
|
||||
<div class="headertitle"><div class="title">unordered_set< K > Class Template Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>STL class.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="dynheader">
|
||||
Collaboration diagram for unordered_set< K >:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d60/classunordered__set__coll__graph.svg" width="147" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<center><span class="legend">[<a target="top" href="../../graph_legend.html">legend</a>]</span></center></div>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d02/classunordered__set_1_1const__iterator.html">const_iterator</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">STL iterator class. <a href="../../da/d02/classunordered__set_1_1const__iterator.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d21/classunordered__set_1_1const__reverse__iterator.html">const_reverse_iterator</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">STL iterator class. <a href="../../d7/d21/classunordered__set_1_1const__reverse__iterator.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5e/classunordered__set_1_1iterator.html">iterator</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">STL iterator class. <a href="../../d9/d5e/classunordered__set_1_1iterator.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/da8/classunordered__set_1_1reverse__iterator.html">reverse_iterator</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">STL iterator class. <a href="../../dc/da8/classunordered__set_1_1reverse__iterator.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
Public Attributes</h2></td></tr>
|
||||
<tr class="memitem:a9401ae48c5b80204409ee475f277cdb0" id="r_a9401ae48c5b80204409ee475f277cdb0"><td class="memItemLeft" align="right" valign="top"><a id="a9401ae48c5b80204409ee475f277cdb0" name="a9401ae48c5b80204409ee475f277cdb0"></a>
|
||||
K </td><td class="memItemRight" valign="bottom"><b>keys</b></td></tr>
|
||||
<tr class="memdesc:a9401ae48c5b80204409ee475f277cdb0"><td class="mdescLeft"> </td><td class="mdescRight">STL member. <br /></td></tr>
|
||||
<tr class="separator:a9401ae48c5b80204409ee475f277cdb0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>STL class. </p>
|
||||
</div><hr/>The documentation for this class was generated from the following files:</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="../../d3/d6d/classunordered__set.html">unordered_set</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
8
d3/d6d/classunordered__set.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var classunordered__set =
|
||||
[
|
||||
[ "const_iterator", "da/d02/classunordered__set_1_1const__iterator.html", null ],
|
||||
[ "const_reverse_iterator", "d7/d21/classunordered__set_1_1const__reverse__iterator.html", null ],
|
||||
[ "iterator", "d9/d5e/classunordered__set_1_1iterator.html", null ],
|
||||
[ "reverse_iterator", "dc/da8/classunordered__set_1_1reverse__iterator.html", null ],
|
||||
[ "keys", "d3/d6d/classunordered__set.html#a9401ae48c5b80204409ee475f277cdb0", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: simpson_method Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d3/d6d/namespacesimpson__method.html','../../'); initR
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d3/d6d/namespacesimpson__method.html">simpson_method</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/floyd_cycle_detection_algo.cpp Pages: 1 -->
|
||||
<svg width="252pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: search/floyd_cycle_detection_algo.cpp Pages: 1 -->
|
||||
<svg width="252pt" height="94pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/brute_force_string_searching.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -154,6 +154,8 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:aeb2cd81064717aedd62bfb096b1a73d8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aeb2cd81064717aedd62bfb096b1a73d8" id="r_aeb2cd81064717aedd62bfb096b1a73d8"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a> (const std::string &text, const std::string &pattern)</td></tr>
|
||||
<tr class="separator:aeb2cd81064717aedd62bfb096b1a73d8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
|
||||
Variables</h2></td></tr>
|
||||
@@ -165,6 +167,54 @@ Variables</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp_source.html">brute_force_string_searching.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="aeb2cd81064717aedd62bfb096b1a73d8" name="aeb2cd81064717aedd62bfb096b1a73d8"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aeb2cd81064717aedd62bfb096b1a73d8">◆ </a></span>brute_force()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int string_search::brute_force </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>text</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>pattern</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Find a pattern in a string by comparing the pattern to every substring. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">text</td><td>Any string that might contain the pattern. </td></tr>
|
||||
<tr><td class="paramname">pattern</td><td>String that we are searching for. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Index where the pattern starts in the text </dd>
|
||||
<dd>
|
||||
-1 if the pattern was not found. </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp_source.html#l00021">21</a> of file <a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp_source.html">brute_force_string_searching.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 21</span> {</div>
|
||||
<div class="line"><span class="lineno"> 22</span> <span class="keywordtype">size_t</span> pat_l = pattern.length();</div>
|
||||
<div class="line"><span class="lineno"> 23</span> <span class="keywordtype">size_t</span> txt_l = text.length();</div>
|
||||
<div class="line"><span class="lineno"> 24</span> <span class="keywordtype">int</span> index = -1;</div>
|
||||
<div class="line"><span class="lineno"> 25</span> <span class="keywordflow">if</span> (pat_l <= txt_l) {</div>
|
||||
<div class="line"><span class="lineno"> 26</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < txt_l - pat_l + 1; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 27</span> std::string s = text.substr(i, pat_l);</div>
|
||||
<div class="line"><span class="lineno"> 28</span> <span class="keywordflow">if</span> (s == pattern) {</div>
|
||||
<div class="line"><span class="lineno"> 29</span> index = i;</div>
|
||||
<div class="line"><span class="lineno"> 30</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 31</span> }</div>
|
||||
<div class="line"><span class="lineno"> 32</span> }</div>
|
||||
<div class="line"><span class="lineno"> 33</span> }</div>
|
||||
<div class="line"><span class="lineno"> 34</span> <span class="keywordflow">return</span> index;</div>
|
||||
<div class="line"><span class="lineno"> 35</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
@@ -184,7 +234,7 @@ Variables</h2></td></tr>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp_source.html#l00047">47</a> of file <a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp_source.html">brute_force_string_searching.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 47</span> {</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &i : <a class="code hl_variable" href="#ae2abaa9caa13fff35e45edca00bee123">test_set</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordtype">int</span> output = brute_force(i[0], i[1]);</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordtype">int</span> output = <a class="code hl_function" href="#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a>(i[0], i[1]);</div>
|
||||
<div class="line"><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="keywordflow">if</span> (std::to_string(output) == i[2]) {</div>
|
||||
<div class="line"><span class="lineno"> 52</span> std::cout << <span class="stringliteral">"success\n"</span>;</div>
|
||||
@@ -195,6 +245,7 @@ Variables</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 58</span>}</div>
|
||||
<div class="ttc" id="abrute__force__string__searching_8cpp_html_ae2abaa9caa13fff35e45edca00bee123"><div class="ttname"><a href="#ae2abaa9caa13fff35e45edca00bee123">test_set</a></div><div class="ttdeci">const std::vector< std::vector< std::string > > test_set</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d7d/brute__force__string__searching_8cpp_source.html#l00041">brute_force_string_searching.cpp:41</a></div></div>
|
||||
<div class="ttc" id="abrute__force__string__searching_8cpp_html_aeb2cd81064717aedd62bfb096b1a73d8"><div class="ttname"><a href="#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a></div><div class="ttdeci">int brute_force(const std::string &text, const std::string &pattern)</div><div class="ttdef"><b>Definition</b> <a href="../../d3/d7d/brute__force__string__searching_8cpp_source.html#l00021">brute_force_string_searching.cpp:21</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -230,7 +281,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_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp.html">brute_force_string_searching.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var brute__force__string__searching_8cpp =
|
||||
[
|
||||
[ "brute_force", "d3/d7d/brute__force__string__searching_8cpp.html#aeb2cd81064717aedd62bfb096b1a73d8", null ],
|
||||
[ "string_search::brute_force", "d9/d03/namespacestring__search.html#aeb2cd81064717aedd62bfb096b1a73d8", null ],
|
||||
[ "main", "d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test_set", "d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/brute_force_string_searching.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,7 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
|
||||
<div class="headertitle"><div class="title">brute_force_string_searching.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d7d/brute__force__string__searching_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="../../d3/d7d/brute__force__string__searching_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#ifdef _MSC_VER</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <string></span> <span class="comment">// use this for MS Visual C++</span></div>
|
||||
@@ -156,18 +156,18 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
|
||||
</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">using </span><a class="code hl_function" href="../../d9/d03/namespacestring__search.html#aeb2cd81064717aedd62bfb096b1a73d8">string_search::brute_force</a>;</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div>
|
||||
<div class="foldopen" id="foldopen00041" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123"> 41</a></span><span class="keyword">const</span> std::vector<std::vector<std::string>> <a class="code hl_variable" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123">test_set</a> = {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// {text, pattern, expected output}</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> {<span class="stringliteral">"a"</span>, <span class="stringliteral">"aa"</span>, <span class="stringliteral">"-1"</span>}, {<span class="stringliteral">"a"</span>, <span class="stringliteral">"a"</span>, <span class="stringliteral">"0"</span>}, {<span class="stringliteral">"ba"</span>, <span class="stringliteral">"b"</span>, <span class="stringliteral">"0"</span>},</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> {<span class="stringliteral">"bba"</span>, <span class="stringliteral">"bb"</span>, <span class="stringliteral">"0"</span>}, {<span class="stringliteral">"bbca"</span>, <span class="stringliteral">"c"</span>, <span class="stringliteral">"2"</span>}, {<span class="stringliteral">"ab"</span>, <span class="stringliteral">"b"</span>, <span class="stringliteral">"1"</span>}};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 47</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &i : <a class="code hl_variable" href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123">test_set</a>) {</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> output = brute_force(i[0], i[1]);</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> output = <a class="code hl_function" href="../../d3/d7d/brute__force__string__searching_8cpp.html#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a>(i[0], i[1]);</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (std::to_string(output) == i[2]) {</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> std::cout << <span class="stringliteral">"success\n"</span>;</div>
|
||||
@@ -180,6 +180,7 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
|
||||
</div>
|
||||
<div class="ttc" id="abrute__force__string__searching_8cpp_html_ae2abaa9caa13fff35e45edca00bee123"><div class="ttname"><a href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae2abaa9caa13fff35e45edca00bee123">test_set</a></div><div class="ttdeci">const std::vector< std::vector< std::string > > test_set</div><div class="ttdef"><b>Definition</b> <a href="#l00041">brute_force_string_searching.cpp:41</a></div></div>
|
||||
<div class="ttc" id="abrute__force__string__searching_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d7d/brute__force__string__searching_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00047">brute_force_string_searching.cpp:47</a></div></div>
|
||||
<div class="ttc" id="abrute__force__string__searching_8cpp_html_aeb2cd81064717aedd62bfb096b1a73d8"><div class="ttname"><a href="../../d3/d7d/brute__force__string__searching_8cpp.html#aeb2cd81064717aedd62bfb096b1a73d8">brute_force</a></div><div class="ttdeci">int brute_force(const std::string &text, const std::string &pattern)</div><div class="ttdef"><b>Definition</b> <a href="#l00021">brute_force_string_searching.cpp:21</a></div></div>
|
||||
<div class="ttc" id="anamespacestring__search_html"><div class="ttname"><a href="../../d9/d03/namespacestring__search.html">string_search</a></div><div class="ttdoc">String search algorithms.</div><div class="ttdef"><b>Definition</b> <a href="#l00013">brute_force_string_searching.cpp:13</a></div></div>
|
||||
<div class="ttc" id="anamespacestring__search_html_aeb2cd81064717aedd62bfb096b1a73d8"><div class="ttname"><a href="../../d9/d03/namespacestring__search.html#aeb2cd81064717aedd62bfb096b1a73d8">string_search::brute_force</a></div><div class="ttdeci">int brute_force(const std::string &text, const std::string &pattern)</div><div class="ttdef"><b>Definition</b> <a href="#l00021">brute_force_string_searching.cpp:21</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
@@ -188,7 +189,7 @@ $(function(){initNavTree('d3/d7d/brute__force__string__searching_8cpp_source.htm
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d7d/brute__force__string__searching_8cpp.html">brute_force_string_searching.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/z_function.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -258,7 +258,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">
|
||||
@@ -357,7 +357,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_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d80/z__function_8cpp.html">z_function.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/z_function.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d3/d80/z__function_8cpp_source.html','../../'); initRe
|
||||
<div class="headertitle"><div class="title">z_function.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d80/z__function_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="../../d3/d80/z__function_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 <cstdint></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#ifdef _MSC_VER</span></div>
|
||||
@@ -134,7 +135,7 @@ $(function(){initNavTree('d3/d80/z__function_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
||||
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="../../d3/d80/z__function_8cpp.html#ac044c4794349a8cff6256b99950d5773"> 29</a></span>std::vector<uint64_t> <a class="code hl_function" href="../../d3/d80/z__function_8cpp.html#ac044c4794349a8cff6256b99950d5773">Z_function</a>(<span class="keyword">const</span> std::string &pattern) {</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> uint64_t pattern_length = pattern.size();</div>
|
||||
@@ -155,7 +156,7 @@ $(function(){initNavTree('d3/d80/z__function_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">return</span> z;</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span></div>
|
||||
<div class="foldopen" id="foldopen00054" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d3/d80/z__function_8cpp.html#ac186ca3ac3a69b5e52543bb13fe46db8"> 54</a></span>std::vector<uint64_t> <a class="code hl_function" href="../../d3/d80/z__function_8cpp.html#ac186ca3ac3a69b5e52543bb13fe46db8">find_pat_in_text</a>(<span class="keyword">const</span> std::string &pattern,</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">const</span> std::string &text) {</div>
|
||||
@@ -171,7 +172,7 @@ $(function(){initNavTree('d3/d80/z__function_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> matching_indexes;</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="foldopen00072" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../d3/d80/z__function_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 72</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d80/z__function_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// usual case</span></div>
|
||||
@@ -207,7 +208,7 @@ $(function(){initNavTree('d3/d80/z__function_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> assert((matching_indexes4 == std::vector<uint64_t>{0, 1, 2, 3, 4, 5, 6}));</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span></div>
|
||||
<div class="foldopen" id="foldopen00110" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="../../d3/d80/z__function_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 110</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d80/z__function_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_function" href="../../d3/d80/z__function_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -224,7 +225,7 @@ $(function(){initNavTree('d3/d80/z__function_8cpp_source.html','../../'); initRe
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/d80/z__function_8cpp.html">z_function.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/word_break.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -156,7 +156,7 @@ Namespaces</h2></td></tr>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a1cc9dd6e6190d10a010fdcdfe7a21a81" id="r_a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a1cc9dd6e6190d10a010fdcdfe7a21a81">dynamic_programming::word_break::exists</a> (const std::string &str, const std::unordered_set< std::string > &strSet)</td></tr>
|
||||
<tr class="memdesc:a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="mdescLeft"> </td><td class="mdescRight">Function that checks if the string passed in param is present in the the unordered_set passed. <br /></td></tr>
|
||||
<tr class="memdesc:a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="mdescLeft"> </td><td class="mdescRight">Function that checks if the string passed in param is present in the the <a class="el" href="../../d3/d6d/classunordered__set.html" title="STL class.">unordered_set</a> passed. <br /></td></tr>
|
||||
<tr class="separator:a1cc9dd6e6190d10a010fdcdfe7a21a81"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a272b0f5cdb4e41fd6dee4538b808c06a" id="r_a272b0f5cdb4e41fd6dee4538b808c06a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#a272b0f5cdb4e41fd6dee4538b808c06a">dynamic_programming::word_break::check</a> (const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)</td></tr>
|
||||
<tr class="memdesc:a272b0f5cdb4e41fd6dee4538b808c06a"><td class="mdescLeft"> </td><td class="mdescRight">Function that checks if the string passed in param can be segmented from position 'pos', and then correctly go on to segment the rest of the string correctly as well to reach a solution. <br /></td></tr>
|
||||
@@ -254,18 +254,17 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="comment">// if the prefix till current position is present in the dictionary</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="comment">// and the remaining substring can also be segmented legally, then</span></div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="comment">// set solution at position pos in the memo, and return true</span></div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a1cc9dd6e6190d10a010fdcdfe7a21a81">exists</a>(wordTillNow, strSet) && check(s, strSet, i + 1, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>)) {</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">if</span> (exists(wordTillNow, strSet) && check(s, strSet, i + 1, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>)) {</div>
|
||||
<div class="line"><span class="lineno"> 109</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>->at(pos) = 1;</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 111</span> }</div>
|
||||
<div class="line"><span class="lineno"> 112</span> }</div>
|
||||
<div class="line"><span class="lineno"> 113</span> <span class="comment">// if function has still not returned, then there must be no legal</span></div>
|
||||
<div class="line"><span class="lineno"> 114</span> <span class="comment">// segmentation possible after segmenting at pos</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>->at(pos) = 0; <span class="comment">// so set solution at pos as false</span></div>
|
||||
<div class="line"><span class="lineno"> 115</span> dp->at(pos) = 0; <span class="comment">// so set solution at pos as false</span></div>
|
||||
<div class="line"><span class="lineno"> 116</span> <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// and return no solution at position pos</span></div>
|
||||
<div class="line"><span class="lineno"> 117</span>}</div>
|
||||
<div class="ttc" id="anamespacedp_html"><div class="ttname"><a href="../../df/d88/namespacedp.html">dp</a></div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition</b> <a href="../../de/d8c/partition__problem_8cpp_source.html#l00039">partition_problem.cpp:39</a></div></div>
|
||||
<div class="ttc" id="aword__break_8cpp_html_a1cc9dd6e6190d10a010fdcdfe7a21a81"><div class="ttname"><a href="#a1cc9dd6e6190d10a010fdcdfe7a21a81">dynamic_programming::word_break::exists</a></div><div class="ttdeci">bool exists(const std::string &str, const std::unordered_set< std::string > &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>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -288,7 +287,7 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Function that checks if the string passed in param is present in the the unordered_set passed. </p>
|
||||
<p>Function that checks if the string passed in param is present in the the <a class="el" href="../../d3/d6d/classunordered__set.html" title="STL class.">unordered_set</a> passed. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">str</td><td>the string to be searched </td></tr>
|
||||
@@ -362,7 +361,7 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
|
||||
</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">
|
||||
@@ -377,7 +376,7 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
|
||||
<div class="line"><span class="lineno"> 159</span> <span class="comment">// the dictionary to be used</span></div>
|
||||
<div class="line"><span class="lineno"> 160</span> <span class="keyword">const</span> std::vector<std::string> wordDict = {<span class="stringliteral">"apple"</span>, <span class="stringliteral">"pen"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(dynamic_programming::word_break::wordBreak(s, wordDict));</div>
|
||||
<div class="line"><span class="lineno"> 162</span> assert(<a class="code hl_function" href="#afe4dcd6fd5282e535685361cba645d7c">dynamic_programming::word_break::wordBreak</a>(s, wordDict));</div>
|
||||
<div class="line"><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><span class="lineno"> 164</span> <span class="comment">// should return true, as applepenapple can be segmented as apple + pen +</span></div>
|
||||
<div class="line"><span class="lineno"> 165</span> <span class="comment">// apple</span></div>
|
||||
@@ -446,7 +445,7 @@ pen apple". Note that you are allowed to reuse a dictionary word.</p>
|
||||
<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="../../d3/d84/word__break_8cpp.html">word_break.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>
|
||||
|
||||
6
d3/d84/word__break_8cpp.js
vendored
@@ -1,8 +1,8 @@
|
||||
var word__break_8cpp =
|
||||
[
|
||||
[ "check", "d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a", null ],
|
||||
[ "exists", "d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81", null ],
|
||||
[ "dynamic_programming::word_break::check", "d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a", null ],
|
||||
[ "dynamic_programming::word_break::exists", "d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81", null ],
|
||||
[ "main", "d3/d84/word__break_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d3/d84/word__break_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
|
||||
[ "wordBreak", "d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c", null ]
|
||||
[ "dynamic_programming::word_break::wordBreak", "d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: dynamic_programming/word_break.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,27 +124,28 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="headertitle"><div class="title">word_break.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d84/word__break_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="../../d3/d84/word__break_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 <cassert></span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include <climits></span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#include <string></span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#include <unordered_set></span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#include <vector></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="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a> {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d53/namespaceword__break.html">word_break</a> {</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span></div>
|
||||
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="../../d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81"> 60</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81">exists</a>(<span class="keyword">const</span> std::string &str,</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">const</span> std::unordered_set<std::string> &strSet) {</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">return</span> strSet.find(str) != strSet.end();</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span></div>
|
||||
<div class="foldopen" id="foldopen00080" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a"> 80</a></span><span class="keywordtype">bool</span> check(<span class="keyword">const</span> std::string &s, <span class="keyword">const</span> std::unordered_set<std::string> &strSet,</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a"> 80</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a>(<span class="keyword">const</span> std::string &s, <span class="keyword">const</span> std::unordered_set<std::string> &strSet,</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordtype">int</span> pos, std::vector<int> *<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>) {</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">if</span> (pos == s.length()) {</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// if we have reached till the end of the string, means we have</span></div>
|
||||
@@ -172,7 +173,7 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="comment">// if the prefix till current position is present in the dictionary</span></div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// and the remaining substring can also be segmented legally, then</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">// set solution at position pos in the memo, and return true</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81">exists</a>(wordTillNow, strSet) && check(s, strSet, i + 1, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>)) {</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a1cc9dd6e6190d10a010fdcdfe7a21a81">exists</a>(wordTillNow, strSet) && <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a>(s, strSet, i + 1, <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>)) {</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>->at(pos) = 1;</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> }</div>
|
||||
@@ -183,7 +184,7 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// and return no solution at position pos</span></div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span></div>
|
||||
<div class="foldopen" id="foldopen00131" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="../../d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c"> 131</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c">wordBreak</a>(<span class="keyword">const</span> std::string &s, <span class="keyword">const</span> std::vector<std::string> &wordDict) {</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// unordered set to store words in the dictionary for constant time</span></div>
|
||||
@@ -200,13 +201,13 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="comment">// calling check method with position = 0, to check from left</span></div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="comment">// from where can be start segmenting the complete string in correct</span></div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="comment">// manner</span></div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">return</span> check(s, strSet, 0, &<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>);</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a>(s, strSet, 0, &<a class="code hl_namespace" href="../../df/d88/namespacedp.html">dp</a>);</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span>} <span class="comment">// namespace word_break</span></div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span>} <span class="comment">// namespace dynamic_programming</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="foldopen" id="foldopen00156" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="../../d3/d84/word__break_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 156</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// the complete string</span></div>
|
||||
@@ -214,15 +215,16 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="comment">// the dictionary to be used</span></div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">const</span> std::vector<std::string> wordDict = {<span class="stringliteral">"apple"</span>, <span class="stringliteral">"pen"</span>};</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> assert(dynamic_programming::word_break::wordBreak(s, wordDict));</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> assert(<a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c">dynamic_programming::word_break::wordBreak</a>(s, wordDict));</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> </div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="comment">// should return true, as applepenapple can be segmented as apple + pen +</span></div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="comment">// apple</span></div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> std::cout << dynamic_programming::word_break::wordBreak(s, wordDict)</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> std::cout << <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c">dynamic_programming::word_break::wordBreak</a>(s, wordDict)</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> std::cout << <span class="stringliteral">"Test implementation passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span></div>
|
||||
<div class="foldopen" id="foldopen00174" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"><a class="line" href="../../d3/d84/word__break_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 174</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// call the test function :)</span></div>
|
||||
@@ -234,7 +236,7 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="comment">// should return true, as applepenapple can be segmented as apple + pen +</span></div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="comment">// apple</span></div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> std::cout << dynamic_programming::word_break::wordBreak(s, wordDict)</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> std::cout << <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c">dynamic_programming::word_break::wordBreak</a>(s, wordDict)</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span>}</div>
|
||||
</div>
|
||||
@@ -242,6 +244,7 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<div class="ttc" id="anamespacedynamic__programming_html"><div class="ttname"><a href="../../dd/d24/namespacedynamic__programming.html">dynamic_programming</a></div><div class="ttdoc">Dynamic Programming algorithms.</div></div>
|
||||
<div class="ttc" id="anamespaceword__break_html"><div class="ttname"><a href="../../d6/d53/namespaceword__break.html">word_break</a></div><div class="ttdoc">Functions for Word Break problem.</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 &str, const std::unordered_set< std::string > &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="#l00060">word_break.cpp:60</a></div></div>
|
||||
<div class="ttc" id="aword__break_8cpp_html_a272b0f5cdb4e41fd6dee4538b808c06a"><div class="ttname"><a href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">dynamic_programming::word_break::check</a></div><div class="ttdeci">bool check(const std::string &s, const std::unordered_set< std::string > &strSet, int pos, std::vector< int > *dp)</div><div class="ttdoc">Function that checks if the string passed in param can be segmented from position 'pos',...</div><div class="ttdef"><b>Definition</b> <a href="#l00080">word_break.cpp:80</a></div></div>
|
||||
<div class="ttc" id="aword__break_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d3/d84/word__break_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00156">word_break.cpp:156</a></div></div>
|
||||
<div class="ttc" id="aword__break_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d84/word__break_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="#l00174">word_break.cpp:174</a></div></div>
|
||||
<div class="ttc" id="aword__break_8cpp_html_afe4dcd6fd5282e535685361cba645d7c"><div class="ttname"><a href="../../d3/d84/word__break_8cpp.html#afe4dcd6fd5282e535685361cba645d7c">dynamic_programming::word_break::wordBreak</a></div><div class="ttdeci">bool wordBreak(const std::string &s, const std::vector< std::string > &wordDict)</div><div class="ttdoc">Function that checks if the string passed in param can be segmented into the strings present in the v...</div><div class="ttdef"><b>Definition</b> <a href="#l00131">word_break.cpp:131</a></div></div>
|
||||
@@ -251,7 +254,7 @@ $(function(){initNavTree('d3/d84/word__break_8cpp_source.html','../../'); initRe
|
||||
<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="../../d3/d84/word__break_8cpp.html">word_break.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strassens_multiplication Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d3/d91/namespacestrassens__multiplication.html','../..
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d3/d91/namespacestrassens__multiplication.html">strassens_multiplication</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/pancake_sort.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -153,11 +153,11 @@ 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:a99e27ad84ad43df9977776b1a8d5416e" id="r_a99e27ad84ad43df9977776b1a8d5416e"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:a99e27ad84ad43df9977776b1a8d5416e" id="r_a99e27ad84ad43df9977776b1a8d5416e"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:a99e27ad84ad43df9977776b1a8d5416e"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a99e27ad84ad43df9977776b1a8d5416e">sorting::pancake_sort::reverse</a> (std::vector< T > &arr, int start, int end)</td></tr>
|
||||
<tr class="memdesc:a99e27ad84ad43df9977776b1a8d5416e"><td class="mdescLeft"> </td><td class="mdescRight">This implementation is for reversing elements in a a C-style array . <br /></td></tr>
|
||||
<tr class="separator:a99e27ad84ad43df9977776b1a8d5416e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:abff90bc0f54e4f8ea5f0330471781bd5" id="r_abff90bc0f54e4f8ea5f0330471781bd5"><td class="memTemplParams" colspan="2">template<typename T > </td></tr>
|
||||
<tr class="memitem:abff90bc0f54e4f8ea5f0330471781bd5" id="r_abff90bc0f54e4f8ea5f0330471781bd5"><td class="memTemplParams" colspan="2">template<typename T> </td></tr>
|
||||
<tr class="memitem:abff90bc0f54e4f8ea5f0330471781bd5"><td class="memTemplItemLeft" align="right" valign="top">int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#abff90bc0f54e4f8ea5f0330471781bd5">sorting::pancake_sort::pancakeSort</a> (std::vector< T > &arr, int size)</td></tr>
|
||||
<tr class="memdesc:abff90bc0f54e4f8ea5f0330471781bd5"><td class="mdescLeft"> </td><td class="mdescRight">This implementation is for a C-style array input that gets modified in place. <br /></td></tr>
|
||||
<tr class="separator:abff90bc0f54e4f8ea5f0330471781bd5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -210,7 +210,7 @@ related <a class="el" href="../../db/dd3/ode__forward__euler_8cpp.html#abaeae8f6
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int sorting::pancake_sort::pancakeSort </td>
|
||||
@@ -263,7 +263,7 @@ template<typename T > </div>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<typename T > </div>
|
||||
template<typename T> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void sorting::pancake_sort::reverse </td>
|
||||
@@ -326,7 +326,7 @@ template<typename T > </div>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -383,7 +383,7 @@ template<typename T > </div>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d3/d92/pancake__sort_8cpp.html">pancake_sort.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
4
d3/d92/pancake__sort_8cpp.js
vendored
@@ -1,7 +1,7 @@
|
||||
var pancake__sort_8cpp =
|
||||
[
|
||||
[ "main", "d3/d92/pancake__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "pancakeSort", "d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5", null ],
|
||||
[ "reverse", "d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e", null ],
|
||||
[ "sorting::pancake_sort::pancakeSort", "d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5", null ],
|
||||
[ "sorting::pancake_sort::reverse", "d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e", null ],
|
||||
[ "test", "d3/d92/pancake__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: sorting/pancake_sort.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,17 +124,18 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div class="headertitle"><div class="title">pancake_sort.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/d92/pancake__sort_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../d3/d92/pancake__sort_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="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 <algorithm></span> <span class="comment">// for std::is_sorted</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <cassert></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 <iostream></span> <span class="comment">// for io operations</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <vector></span> <span class="comment">// for std::vector</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/d91/namespacesorting.html">sorting</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d10/namespacepancake__sort.html">pancake_sort</a> {</div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
||||
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e"> 43</a></span><span class="keywordtype">void</span> reverse(std::vector<T> &arr, <span class="keywordtype">int</span> start, <span class="keywordtype">int</span> end) {</div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e"> 43</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e">reverse</a>(std::vector<T> &arr, <span class="keywordtype">int</span> start, <span class="keywordtype">int</span> end) {</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> T temp; <span class="comment">// Temporary variable</span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">while</span> (start <= end) {</div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> temp = arr[start];</div>
|
||||
@@ -145,6 +146,7 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</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="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></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="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5"> 61</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5">pancakeSort</a>(std::vector<T> &arr, <span class="keywordtype">int</span> size) {</div>
|
||||
@@ -159,8 +161,8 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">if</span> (max_index != i - 1) <span class="comment">// check for reversing</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> {</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> reverse(arr, 0, max_index);</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> reverse(arr, 0, i - 1);</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e">reverse</a>(arr, 0, max_index);</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e">reverse</a>(arr, 0, i - 1);</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> 0;</div>
|
||||
@@ -168,14 +170,14 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span>} <span class="comment">// namespace pancake_sort</span></div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>} <span class="comment">// namespace sorting</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="foldopen" id="foldopen00086" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="../../d3/d92/pancake__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 86</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// example 1: vector of int</span></div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">const</span> <span class="keywordtype">int</span> size1 = 7;</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::cout << <span class="stringliteral">"\nTest 1- as std::vector<int>..."</span>;</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> std::vector<int> arr1 = {23, 10, 20, 11, 12, 6, 7};</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> sorting::pancake_sort::pancakeSort(arr1, size1);</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5">sorting::pancake_sort::pancakeSort</a>(arr1, size1);</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> assert(std::is_sorted(arr1.begin(), arr1.end()));</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::cout << <span class="stringliteral">"Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size1; i++) {</div>
|
||||
@@ -188,7 +190,7 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> std::cout << <span class="stringliteral">"\nTest 2- as std::vector<double>..."</span>;</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> std::vector<double> arr2 = {23.56, 10.62, 200.78, 111.484,</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> 3.9, 1.2, 61.77, 79.6};</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> sorting::pancake_sort::pancakeSort(arr2, size2);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5">sorting::pancake_sort::pancakeSort</a>(arr2, size2);</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> assert(std::is_sorted(arr2.begin(), arr2.end()));</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> std::cout << <span class="stringliteral">"Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size2; i++) {</div>
|
||||
@@ -200,7 +202,7 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">const</span> <span class="keywordtype">int</span> size3 = 7;</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::cout << <span class="stringliteral">"\nTest 3- as std::vector<float>..."</span>;</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::vector<float> arr3 = {6.56, 12.62, 200.78, 768.484, 19.27, 68.87, 9.6};</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> sorting::pancake_sort::pancakeSort(arr3, size3);</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5">sorting::pancake_sort::pancakeSort</a>(arr3, size3);</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> assert(std::is_sorted(arr3.begin(), arr3.end()));</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::cout << <span class="stringliteral">"Passed\n"</span>;</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < size3; i++) {</div>
|
||||
@@ -209,6 +211,7 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::cout << std::endl;</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</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="../../d3/d92/pancake__sort_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 128</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/d92/pancake__sort_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="../../d3/d92/pancake__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
|
||||
@@ -217,6 +220,7 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
</div>
|
||||
<div class="ttc" id="anamespacepancake__sort_html"><div class="ttname"><a href="../../df/d10/namespacepancake__sort.html">pancake_sort</a></div><div class="ttdoc">Functions for Pancake sort algorithm.</div></div>
|
||||
<div class="ttc" id="anamespacesorting_html"><div class="ttname"><a href="../../d5/d91/namespacesorting.html">sorting</a></div><div class="ttdoc">for working with vectors</div></div>
|
||||
<div class="ttc" id="apancake__sort_8cpp_html_a99e27ad84ad43df9977776b1a8d5416e"><div class="ttname"><a href="../../d3/d92/pancake__sort_8cpp.html#a99e27ad84ad43df9977776b1a8d5416e">sorting::pancake_sort::reverse</a></div><div class="ttdeci">void reverse(std::vector< T > &arr, int start, int end)</div><div class="ttdoc">This implementation is for reversing elements in a a C-style array .</div><div class="ttdef"><b>Definition</b> <a href="#l00043">pancake_sort.cpp:43</a></div></div>
|
||||
<div class="ttc" id="apancake__sort_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d3/d92/pancake__sort_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00086">pancake_sort.cpp:86</a></div></div>
|
||||
<div class="ttc" id="apancake__sort_8cpp_html_abff90bc0f54e4f8ea5f0330471781bd5"><div class="ttname"><a href="../../d3/d92/pancake__sort_8cpp.html#abff90bc0f54e4f8ea5f0330471781bd5">sorting::pancake_sort::pancakeSort</a></div><div class="ttdeci">int pancakeSort(std::vector< T > &arr, int size)</div><div class="ttdoc">This implementation is for a C-style array input that gets modified in place.</div><div class="ttdef"><b>Definition</b> <a href="#l00061">pancake_sort.cpp:61</a></div></div>
|
||||
<div class="ttc" id="apancake__sort_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d3/d92/pancake__sort_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="#l00128">pancake_sort.cpp:128</a></div></div>
|
||||
@@ -226,7 +230,7 @@ $(function(){initNavTree('d3/d92/pancake__sort_8cpp_source.html','../../'); init
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_bb1b521853a9c46347182a9d10420771.html">sorting</a></li><li class="navelem"><a class="el" href="../../d3/d92/pancake__sort_8cpp.html">pancake_sort.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -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::tree_234::Tree234 Class Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -271,7 +271,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -316,7 +316,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -363,7 +363,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -443,7 +443,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -469,11 +469,11 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 670</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 671</span> }</div>
|
||||
<div class="line"><span class="lineno"> 672</span> </div>
|
||||
<div class="line"><span class="lineno"> 673</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *next_node = tree->GetNextPossibleChild(item);</div>
|
||||
<div class="line"><span class="lineno"> 673</span> Node *next_node = tree->GetNextPossibleChild(item);</div>
|
||||
<div class="line"><span class="lineno"> 674</span> <span class="keywordflow">if</span> (next_node) {</div>
|
||||
<div class="line"><span class="lineno"> 675</span> split_node.reset(<a class="code hl_function" href="#a6749ebb40710c9752a2771eda03c6b3e">Insert</a>(next_node, item));</div>
|
||||
<div class="line"><span class="lineno"> 676</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 677</span> split_node.reset(<span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>(item));</div>
|
||||
<div class="line"><span class="lineno"> 677</span> split_node.reset(<span class="keyword">new</span> Node(item));</div>
|
||||
<div class="line"><span class="lineno"> 678</span> }</div>
|
||||
<div class="line"><span class="lineno"> 679</span> </div>
|
||||
<div class="line"><span class="lineno"> 680</span> <span class="keywordflow">if</span> (split_node) {</div>
|
||||
@@ -484,7 +484,6 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 685</span>}</div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1tree__234_1_1_tree234_html_a11f0d016dff7f7e62b3dddb9fdf47805"><div class="ttname"><a href="#a11f0d016dff7f7e62b3dddb9fdf47805">data_structures::tree_234::Tree234::MergeNode</a></div><div class="ttdeci">Node * MergeNode(Node *dst_node, Node *node)</div><div class="ttdoc">A helper function used during post-merge insert.</div><div class="ttdef"><b>Definition</b> <a href="../../db/dbc/tree__234_8cpp_source.html#l00700">tree_234.cpp:700</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1tree__234_1_1_tree234_html_a6749ebb40710c9752a2771eda03c6b3e"><div class="ttname"><a href="#a6749ebb40710c9752a2771eda03c6b3e">data_structures::tree_234::Tree234::Insert</a></div><div class="ttdeci">void Insert(int64_t item)</div><div class="ttdoc">Insert item to tree.</div><div class="ttdef"><b>Definition</b> <a href="../../db/dbc/tree__234_8cpp_source.html#l00655">tree_234.cpp:655</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><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -506,7 +505,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -522,11 +521,11 @@ Private Attributes</h2></td></tr>
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00637">637</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 637</span> {</div>
|
||||
<div class="line"><span class="lineno"> 638</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 639</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>(item);</div>
|
||||
<div class="line"><span class="lineno"> 639</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = <span class="keyword">new</span> Node(item);</div>
|
||||
<div class="line"><span class="lineno"> 640</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 641</span> }</div>
|
||||
<div class="line"><span class="lineno"> 642</span> </div>
|
||||
<div class="line"><span class="lineno"> 643</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *split_node = <a class="code hl_function" href="#a6749ebb40710c9752a2771eda03c6b3e">Insert</a>(<a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>, item);</div>
|
||||
<div class="line"><span class="lineno"> 643</span> Node *split_node = <a class="code hl_function" href="#a6749ebb40710c9752a2771eda03c6b3e">Insert</a>(<a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>, item);</div>
|
||||
<div class="line"><span class="lineno"> 644</span> </div>
|
||||
<div class="line"><span class="lineno"> 645</span> <span class="comment">// if root has split, then update root_</span></div>
|
||||
<div class="line"><span class="lineno"> 646</span> <span class="keywordflow">if</span> (split_node) {</div>
|
||||
@@ -554,7 +553,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -570,33 +569,33 @@ Private Attributes</h2></td></tr>
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00585">585</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 585</span> {</div>
|
||||
<div class="line"><span class="lineno"> 586</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 587</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = <span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>(item);</div>
|
||||
<div class="line"><span class="lineno"> 587</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = <span class="keyword">new</span> Node(item);</div>
|
||||
<div class="line"><span class="lineno"> 588</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 589</span> }</div>
|
||||
<div class="line"><span class="lineno"> 590</span> </div>
|
||||
<div class="line"><span class="lineno"> 591</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *parent = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 592</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> = <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>;</div>
|
||||
<div class="line"><span class="lineno"> 591</span> Node *parent = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 592</span> Node *<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>;</div>
|
||||
<div class="line"><span class="lineno"> 593</span> </div>
|
||||
<div class="line"><span class="lineno"> 594</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 595</span> <span class="keywordflow">if</span> (!<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 596</span> std::unique_ptr<Node> tmp(<span class="keyword">new</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a>(item));</div>
|
||||
<div class="line"><span class="lineno"> 595</span> <span class="keywordflow">if</span> (!<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 596</span> std::unique_ptr<Node> tmp(<span class="keyword">new</span> Node(item));</div>
|
||||
<div class="line"><span class="lineno"> 597</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(parent, tmp.get());</div>
|
||||
<div class="line"><span class="lineno"> 598</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 599</span> }</div>
|
||||
<div class="line"><span class="lineno"> 600</span> </div>
|
||||
<div class="line"><span class="lineno"> 601</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->Contains(item)) {</div>
|
||||
<div class="line"><span class="lineno"> 601</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->Contains(item)) {</div>
|
||||
<div class="line"><span class="lineno"> 602</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 603</span> }</div>
|
||||
<div class="line"><span class="lineno"> 604</span> </div>
|
||||
<div class="line"><span class="lineno"> 605</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->IsFull()) {</div>
|
||||
<div class="line"><span class="lineno"> 606</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <a class="code hl_function" href="#a370b625ca9f16bbef2b65e024ef78ea9">SplitNode</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 605</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->IsFull()) {</div>
|
||||
<div class="line"><span class="lineno"> 606</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_function" href="#a370b625ca9f16bbef2b65e024ef78ea9">SplitNode</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 607</span> </div>
|
||||
<div class="line"><span class="lineno"> 608</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *cur_node = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 608</span> Node *cur_node = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 609</span> </div>
|
||||
<div class="line"><span class="lineno"> 610</span> <span class="keywordflow">if</span> (item < node->GetItem(0)) {</div>
|
||||
<div class="line"><span class="lineno"> 611</span> cur_node = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(0);</div>
|
||||
<div class="line"><span class="lineno"> 611</span> cur_node = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(0);</div>
|
||||
<div class="line"><span class="lineno"> 612</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 613</span> cur_node = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(1);</div>
|
||||
<div class="line"><span class="lineno"> 613</span> cur_node = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(1);</div>
|
||||
<div class="line"><span class="lineno"> 614</span> }</div>
|
||||
<div class="line"><span class="lineno"> 615</span> </div>
|
||||
<div class="line"><span class="lineno"> 616</span> <span class="keywordflow">if</span> (!parent) {</div>
|
||||
@@ -605,20 +604,19 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 619</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 620</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 621</span> <span class="comment">// merge the split parent to its origin parent</span></div>
|
||||
<div class="line"><span class="lineno"> 622</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(parent, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 622</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(parent, <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 623</span> }</div>
|
||||
<div class="line"><span class="lineno"> 624</span> </div>
|
||||
<div class="line"><span class="lineno"> 625</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = cur_node;</div>
|
||||
<div class="line"><span class="lineno"> 625</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = cur_node;</div>
|
||||
<div class="line"><span class="lineno"> 626</span> }</div>
|
||||
<div class="line"><span class="lineno"> 627</span> </div>
|
||||
<div class="line"><span class="lineno"> 628</span> parent = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 629</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = parent->GetNextPossibleChild(item);</div>
|
||||
<div class="line"><span class="lineno"> 629</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = parent->GetNextPossibleChild(item);</div>
|
||||
<div class="line"><span class="lineno"> 630</span> }</div>
|
||||
<div class="line"><span class="lineno"> 631</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="aclassdata__structures_1_1tree__234_1_1_tree234_html_a370b625ca9f16bbef2b65e024ef78ea9"><div class="ttname"><a href="#a370b625ca9f16bbef2b65e024ef78ea9">data_structures::tree_234::Tree234::SplitNode</a></div><div class="ttdeci">Node * SplitNode(Node *node)</div><div class="ttdoc">Split a 4-node to 1 parent and 2 children, and return the parent node.</div><div class="ttdef"><b>Definition</b> <a href="../../db/dbc/tree__234_8cpp_source.html#l00745">tree_234.cpp:745</a></div></div>
|
||||
<div class="ttc" id="aclassdata__structures_1_1tree__234_1_1_tree234_html_ad37e29e2a4a6cc0eb65cbd5595e1da95"><div class="ttname"><a href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">data_structures::tree_234::Tree234::MergeNodeNotFull</a></div><div class="ttdeci">void MergeNodeNotFull(Node *dst_node, Node *node)</div><div class="ttdoc">Merge node to a not-full target node.</div><div class="ttdef"><b>Definition</b> <a href="../../db/dbc/tree__234_8cpp_source.html#l00730">tree_234.cpp:730</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>
|
||||
@@ -644,7 +642,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -661,8 +659,8 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00869">869</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 869</span> {</div>
|
||||
<div class="line"><span class="lineno"> 870</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left = parent->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 871</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right = parent->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 870</span> Node *left = parent->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 871</span> Node *right = parent->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 872</span> </div>
|
||||
<div class="line"><span class="lineno"> 873</span> assert(right && right->Is34Node());</div>
|
||||
<div class="line"><span class="lineno"> 874</span> assert(left && left->Is2Node());</div>
|
||||
@@ -697,7 +695,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -719,8 +717,8 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 897</span> </div>
|
||||
<div class="line"><span class="lineno"> 898</span> <span class="comment">// bool is_parent_2node = parent->Is2Node();</span></div>
|
||||
<div class="line"><span class="lineno"> 899</span> </div>
|
||||
<div class="line"><span class="lineno"> 900</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left_child = parent->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 901</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right_child = parent->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 900</span> Node *left_child = parent->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 901</span> Node *right_child = parent->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 902</span> </div>
|
||||
<div class="line"><span class="lineno"> 903</span> assert(left_child->Is2Node() && right_child->Is2Node());</div>
|
||||
<div class="line"><span class="lineno"> 904</span> </div>
|
||||
@@ -767,7 +765,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -785,20 +783,20 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00700">700</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 700</span> {</div>
|
||||
<div class="line"><span class="lineno"> 701</span> assert(dst_node != <span class="keyword">nullptr</span> && <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> != <span class="keyword">nullptr</span>);</div>
|
||||
<div class="line"><span class="lineno"> 701</span> assert(dst_node != <span class="keyword">nullptr</span> && <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> != <span class="keyword">nullptr</span>);</div>
|
||||
<div class="line"><span class="lineno"> 702</span> </div>
|
||||
<div class="line"><span class="lineno"> 703</span> <span class="keywordflow">if</span> (!dst_node->IsFull()) {</div>
|
||||
<div class="line"><span class="lineno"> 704</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(dst_node, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 704</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(dst_node, <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 705</span> <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 706</span> }</div>
|
||||
<div class="line"><span class="lineno"> 707</span> </div>
|
||||
<div class="line"><span class="lineno"> 708</span> dst_node = <a class="code hl_function" href="#a370b625ca9f16bbef2b65e024ef78ea9">SplitNode</a>(dst_node);</div>
|
||||
<div class="line"><span class="lineno"> 709</span> </div>
|
||||
<div class="line"><span class="lineno"> 710</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(0) < dst_node->GetItem(0)) {</div>
|
||||
<div class="line"><span class="lineno"> 711</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(dst_node->GetChild(0), <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 710</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(0) < dst_node->GetItem(0)) {</div>
|
||||
<div class="line"><span class="lineno"> 711</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(dst_node->GetChild(0), <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 712</span> </div>
|
||||
<div class="line"><span class="lineno"> 713</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 714</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(dst_node->GetChild(1), <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 714</span> <a class="code hl_function" href="#ad37e29e2a4a6cc0eb65cbd5595e1da95">MergeNodeNotFull</a>(dst_node->GetChild(1), <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 715</span> }</div>
|
||||
<div class="line"><span class="lineno"> 716</span> </div>
|
||||
<div class="line"><span class="lineno"> 717</span> <span class="keywordflow">return</span> dst_node;</div>
|
||||
@@ -828,7 +826,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -845,12 +843,12 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00730">730</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 730</span> {</div>
|
||||
<div class="line"><span class="lineno"> 731</span> assert(dst_node && <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> && !dst_node->IsFull() && <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->Is2Node());</div>
|
||||
<div class="line"><span class="lineno"> 731</span> assert(dst_node && <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> && !dst_node->IsFull() && <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->Is2Node());</div>
|
||||
<div class="line"><span class="lineno"> 732</span> </div>
|
||||
<div class="line"><span class="lineno"> 733</span> int8_t i = dst_node->InsertItem(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(0));</div>
|
||||
<div class="line"><span class="lineno"> 733</span> int8_t i = dst_node->InsertItem(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(0));</div>
|
||||
<div class="line"><span class="lineno"> 734</span> </div>
|
||||
<div class="line"><span class="lineno"> 735</span> dst_node->SetChild(i, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(0));</div>
|
||||
<div class="line"><span class="lineno"> 736</span> dst_node->SetChild(i + 1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(1));</div>
|
||||
<div class="line"><span class="lineno"> 735</span> dst_node->SetChild(i, <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(0));</div>
|
||||
<div class="line"><span class="lineno"> 736</span> dst_node->SetChild(i + 1, <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(1));</div>
|
||||
<div class="line"><span class="lineno"> 737</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -899,9 +897,9 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 1145</span> ofs << <span class="stringliteral">"node [shape=record]\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1146</span> </div>
|
||||
<div class="line"><span class="lineno"> 1147</span> int64_t index = 0;</div>
|
||||
<div class="line"><span class="lineno"> 1148</span> </div>
|
||||
<div class="line"><span class="lineno"> 1148</span></div>
|
||||
<div class="line"><span class="lineno"> 1151</span> <span class="keyword">struct </span>NodeInfo {</div>
|
||||
<div class="line"><span class="lineno"> 1152</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>; </div>
|
||||
<div class="line"><span class="lineno"> 1152</span> Node *<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>; </div>
|
||||
<div class="line"><span class="lineno"> 1153</span> int64_t index; </div>
|
||||
<div class="line"><span class="lineno"> 1155</span> };</div>
|
||||
<div class="line"><span class="lineno"> 1156</span> </div>
|
||||
@@ -1001,7 +999,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1020,21 +1018,21 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l01226">1226</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 1227</span> {</div>
|
||||
<div class="line"><span class="lineno"> 1228</span> assert(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 1228</span> assert(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>);</div>
|
||||
<div class="line"><span class="lineno"> 1229</span> </div>
|
||||
<div class="line"><span class="lineno"> 1230</span> <span class="keywordflow">switch</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetCount()) {</div>
|
||||
<div class="line"><span class="lineno"> 1230</span> <span class="keywordflow">switch</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetCount()) {</div>
|
||||
<div class="line"><span class="lineno"> 1231</span> <span class="keywordflow">case</span> 1:</div>
|
||||
<div class="line"><span class="lineno"> 1232</span> ofs << <span class="stringliteral">"node_"</span> << index << <span class="stringliteral">" [label=\"<f0> "</span> << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(0)</div>
|
||||
<div class="line"><span class="lineno"> 1232</span> ofs << <span class="stringliteral">"node_"</span> << index << <span class="stringliteral">" [label=\"<f0> "</span> << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(0)</div>
|
||||
<div class="line"><span class="lineno"> 1233</span> << <span class="stringliteral">"\"]\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1234</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1235</span> <span class="keywordflow">case</span> 2:</div>
|
||||
<div class="line"><span class="lineno"> 1236</span> ofs << <span class="stringliteral">"node_"</span> << index << <span class="stringliteral">" [label=\"<f0> "</span> << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(0)</div>
|
||||
<div class="line"><span class="lineno"> 1237</span> << <span class="stringliteral">" | <f1> "</span> << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(1) << <span class="stringliteral">"\"]\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1236</span> ofs << <span class="stringliteral">"node_"</span> << index << <span class="stringliteral">" [label=\"<f0> "</span> << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(0)</div>
|
||||
<div class="line"><span class="lineno"> 1237</span> << <span class="stringliteral">" | <f1> "</span> << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(1) << <span class="stringliteral">"\"]\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1238</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1239</span> <span class="keywordflow">case</span> 3:</div>
|
||||
<div class="line"><span class="lineno"> 1240</span> ofs << <span class="stringliteral">"node_"</span> << index << <span class="stringliteral">" [label=\"<f0> "</span> << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(0)</div>
|
||||
<div class="line"><span class="lineno"> 1241</span> << <span class="stringliteral">" | <f1> "</span> << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(1) << <span class="stringliteral">"| <f2> "</span></div>
|
||||
<div class="line"><span class="lineno"> 1242</span> << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(2) << <span class="stringliteral">"\"]\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1240</span> ofs << <span class="stringliteral">"node_"</span> << index << <span class="stringliteral">" [label=\"<f0> "</span> << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(0)</div>
|
||||
<div class="line"><span class="lineno"> 1241</span> << <span class="stringliteral">" | <f1> "</span> << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(1) << <span class="stringliteral">"| <f2> "</span></div>
|
||||
<div class="line"><span class="lineno"> 1242</span> << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(2) << <span class="stringliteral">"\"]\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1243</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1244</span> </div>
|
||||
<div class="line"><span class="lineno"> 1245</span> <span class="keywordflow">default</span>:</div>
|
||||
@@ -1104,7 +1102,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1121,15 +1119,15 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00937">937</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 937</span> {</div>
|
||||
<div class="line"><span class="lineno"> 938</span> <span class="keywordflow">while</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 939</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->IsLeaf()) {</div>
|
||||
<div class="line"><span class="lineno"> 940</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->Contains(item)) {</div>
|
||||
<div class="line"><span class="lineno"> 941</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->Is2Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 938</span> <span class="keywordflow">while</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 939</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->IsLeaf()) {</div>
|
||||
<div class="line"><span class="lineno"> 940</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->Contains(item)) {</div>
|
||||
<div class="line"><span class="lineno"> 941</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->Is2Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 942</span> <span class="comment">// node must be root</span></div>
|
||||
<div class="line"><span class="lineno"> 943</span> <span class="keyword">delete</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 944</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><span class="lineno"> 945</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 946</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->RemoveItemByIndex(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemIndex(item), <span class="keyword">true</span>);</div>
|
||||
<div class="line"><span class="lineno"> 946</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->RemoveItemByIndex(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemIndex(item), <span class="keyword">true</span>);</div>
|
||||
<div class="line"><span class="lineno"> 947</span> }</div>
|
||||
<div class="line"><span class="lineno"> 948</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 949</span> }</div>
|
||||
@@ -1137,13 +1135,13 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 951</span> }</div>
|
||||
<div class="line"><span class="lineno"> 952</span> </div>
|
||||
<div class="line"><span class="lineno"> 953</span> <span class="comment">// node is internal</span></div>
|
||||
<div class="line"><span class="lineno"> 954</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->Contains(item)) {</div>
|
||||
<div class="line"><span class="lineno"> 955</span> int8_t index = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemIndex(item);</div>
|
||||
<div class="line"><span class="lineno"> 954</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->Contains(item)) {</div>
|
||||
<div class="line"><span class="lineno"> 955</span> int8_t index = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemIndex(item);</div>
|
||||
<div class="line"><span class="lineno"> 956</span> </div>
|
||||
<div class="line"><span class="lineno"> 957</span> <span class="comment">// Here is important!!! What we do next depend on its children's</span></div>
|
||||
<div class="line"><span class="lineno"> 958</span> <span class="comment">// state. Why?</span></div>
|
||||
<div class="line"><span class="lineno"> 959</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left_child = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 960</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right_child = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 959</span> Node *left_child = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 960</span> Node *right_child = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 961</span> assert(left_child && right_child);</div>
|
||||
<div class="line"><span class="lineno"> 962</span> </div>
|
||||
<div class="line"><span class="lineno"> 963</span> <span class="keywordflow">if</span> (left_child->Is2Node() && right_child->Is2Node()) {</div>
|
||||
@@ -1171,14 +1169,14 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 985</span> <span class="comment">//</span></div>
|
||||
<div class="line"><span class="lineno"> 986</span> </div>
|
||||
<div class="line"><span class="lineno"> 987</span> <span class="comment">// node must be the root</span></div>
|
||||
<div class="line"><span class="lineno"> 988</span> <span class="keywordflow">if</span> (<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->Is2Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 988</span> <span class="keywordflow">if</span> (<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->Is2Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 989</span> <span class="comment">// this means we can't avoid merging the target item into</span></div>
|
||||
<div class="line"><span class="lineno"> 990</span> <span class="comment">// next layer, and this will cause us do different process</span></div>
|
||||
<div class="line"><span class="lineno"> 991</span> <span class="comment">// compared with other cases</span></div>
|
||||
<div class="line"><span class="lineno"> 992</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *new_root = <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, index);</div>
|
||||
<div class="line"><span class="lineno"> 992</span> Node *new_root = <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, index);</div>
|
||||
<div class="line"><span class="lineno"> 993</span> <span class="keyword">delete</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>;</div>
|
||||
<div class="line"><span class="lineno"> 994</span> <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a> = new_root;</div>
|
||||
<div class="line"><span class="lineno"> 995</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>;</div>
|
||||
<div class="line"><span class="lineno"> 995</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_variable" href="#a348ea76c7629b2dcf740be062f970a36">root_</a>;</div>
|
||||
<div class="line"><span class="lineno"> 996</span> </div>
|
||||
<div class="line"><span class="lineno"> 997</span> <span class="comment">// now node point to the</span></div>
|
||||
<div class="line"><span class="lineno"> 998</span> <span class="keywordflow">continue</span>;</div>
|
||||
@@ -1192,9 +1190,9 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 1006</span> <span class="keywordflow">if</span> (index > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 1007</span> <span class="comment">// left_child has left-sibling, we check if we can do a</span></div>
|
||||
<div class="line"><span class="lineno"> 1008</span> <span class="comment">// rotate</span></div>
|
||||
<div class="line"><span class="lineno"> 1009</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left_sibling = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemLeftChild(index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1009</span> Node *left_sibling = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemLeftChild(index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1010</span> <span class="keywordflow">if</span> (left_sibling->Is34Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 1011</span> <a class="code hl_function" href="#ae68f8e62be02657c1287def6b38d7cc9">RightRotate</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1011</span> <a class="code hl_function" href="#ae68f8e62be02657c1287def6b38d7cc9">RightRotate</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1012</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1013</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1014</span> }</div>
|
||||
@@ -1202,10 +1200,10 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 1016</span> <span class="keywordflow">if</span> (index < node->GetCount() - 1) {</div>
|
||||
<div class="line"><span class="lineno"> 1017</span> <span class="comment">// right_child has right-sibling, we check if we can do</span></div>
|
||||
<div class="line"><span class="lineno"> 1018</span> <span class="comment">// a rotate</span></div>
|
||||
<div class="line"><span class="lineno"> 1019</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right_sibling =</div>
|
||||
<div class="line"><span class="lineno"> 1020</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemRightChild(index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 1019</span> Node *right_sibling =</div>
|
||||
<div class="line"><span class="lineno"> 1020</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemRightChild(index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 1021</span> <span class="keywordflow">if</span> (right_sibling->Is34Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 1022</span> <a class="code hl_function" href="#ae58dca20f08eaf9313f6e7b0869c2d0e">LeftRotate</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 1022</span> <a class="code hl_function" href="#ae58dca20f08eaf9313f6e7b0869c2d0e">LeftRotate</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 1023</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1024</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1025</span> }</div>
|
||||
@@ -1213,62 +1211,62 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 1027</span> <span class="comment">// we do a merge. We avoid merging the target item, which</span></div>
|
||||
<div class="line"><span class="lineno"> 1028</span> <span class="comment">// may trigger another merge in the recursion process.</span></div>
|
||||
<div class="line"><span class="lineno"> 1029</span> <span class="keywordflow">if</span> (index > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 1030</span> <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1030</span> <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1031</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1032</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1033</span> </div>
|
||||
<div class="line"><span class="lineno"> 1034</span> <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 1034</span> <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 1035</span> </div>
|
||||
<div class="line"><span class="lineno"> 1036</span> } <span class="keywordflow">while</span> (<span class="keyword">false</span>);</div>
|
||||
<div class="line"><span class="lineno"> 1037</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1038</span> </div>
|
||||
<div class="line"><span class="lineno"> 1039</span> <span class="comment">// refresh the left_child and right_child since they may be invalid</span></div>
|
||||
<div class="line"><span class="lineno"> 1040</span> <span class="comment">// because of merge</span></div>
|
||||
<div class="line"><span class="lineno"> 1041</span> left_child = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 1042</span> right_child = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 1041</span> left_child = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 1042</span> right_child = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 1043</span> </div>
|
||||
<div class="line"><span class="lineno"> 1044</span> <span class="keywordflow">if</span> (left_child->Is34Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 1045</span> int64_t predecessor_item = <a class="code hl_function" href="#ac85ba5abfd6d34dcd908b2afe6464657">GetTreeMaxItem</a>(left_child);</div>
|
||||
<div class="line"><span class="lineno"> 1046</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->SetItem(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemIndex(item), predecessor_item);</div>
|
||||
<div class="line"><span class="lineno"> 1046</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->SetItem(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemIndex(item), predecessor_item);</div>
|
||||
<div class="line"><span class="lineno"> 1047</span> </div>
|
||||
<div class="line"><span class="lineno"> 1048</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = left_child;</div>
|
||||
<div class="line"><span class="lineno"> 1048</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = left_child;</div>
|
||||
<div class="line"><span class="lineno"> 1049</span> item = predecessor_item;</div>
|
||||
<div class="line"><span class="lineno"> 1050</span> <span class="keywordflow">continue</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1051</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1052</span> </div>
|
||||
<div class="line"><span class="lineno"> 1053</span> <span class="keywordflow">if</span> (right_child->Is34Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 1054</span> int64_t successor_item = <a class="code hl_function" href="#a65a1235659356166a3e9b451c64fcc36">GetTreeMinItem</a>(right_child);</div>
|
||||
<div class="line"><span class="lineno"> 1055</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->SetItem(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItemIndex(item), successor_item);</div>
|
||||
<div class="line"><span class="lineno"> 1056</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = right_child;</div>
|
||||
<div class="line"><span class="lineno"> 1055</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->SetItem(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItemIndex(item), successor_item);</div>
|
||||
<div class="line"><span class="lineno"> 1056</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = right_child;</div>
|
||||
<div class="line"><span class="lineno"> 1057</span> item = successor_item;</div>
|
||||
<div class="line"><span class="lineno"> 1058</span> <span class="keywordflow">continue</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1059</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1060</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1061</span> </div>
|
||||
<div class="line"><span class="lineno"> 1062</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *next_node = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetNextPossibleChild(item);</div>
|
||||
<div class="line"><span class="lineno"> 1062</span> Node *next_node = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetNextPossibleChild(item);</div>
|
||||
<div class="line"><span class="lineno"> 1063</span> </div>
|
||||
<div class="line"><span class="lineno"> 1064</span> <span class="keywordflow">if</span> (next_node->Is34Node()) {</div>
|
||||
<div class="line"><span class="lineno"> 1065</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = next_node;</div>
|
||||
<div class="line"><span class="lineno"> 1065</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = next_node;</div>
|
||||
<div class="line"><span class="lineno"> 1066</span> <span class="keywordflow">continue</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1067</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1068</span> </div>
|
||||
<div class="line"><span class="lineno"> 1069</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#aec0642d1d151521ca7c70ea85cdb15d3">TryRightRotate</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, next_node)) {</div>
|
||||
<div class="line"><span class="lineno"> 1070</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = next_node;</div>
|
||||
<div class="line"><span class="lineno"> 1069</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#aec0642d1d151521ca7c70ea85cdb15d3">TryRightRotate</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, next_node)) {</div>
|
||||
<div class="line"><span class="lineno"> 1070</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = next_node;</div>
|
||||
<div class="line"><span class="lineno"> 1071</span> <span class="keywordflow">continue</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1072</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1073</span> </div>
|
||||
<div class="line"><span class="lineno"> 1074</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#ac5361479dd996eb331759f33808657d9">TryLeftRotate</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, next_node)) {</div>
|
||||
<div class="line"><span class="lineno"> 1075</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = next_node;</div>
|
||||
<div class="line"><span class="lineno"> 1074</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#ac5361479dd996eb331759f33808657d9">TryLeftRotate</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, next_node)) {</div>
|
||||
<div class="line"><span class="lineno"> 1075</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = next_node;</div>
|
||||
<div class="line"><span class="lineno"> 1076</span> <span class="keywordflow">continue</span>;</div>
|
||||
<div class="line"><span class="lineno"> 1077</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1078</span> </div>
|
||||
<div class="line"><span class="lineno"> 1079</span> <span class="comment">// get here means both left sibling and right sibling of next_node is</span></div>
|
||||
<div class="line"><span class="lineno"> 1080</span> <span class="comment">// 2-node, so we do merge</span></div>
|
||||
<div class="line"><span class="lineno"> 1081</span> int8_t child_index = <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChildIndex(next_node);</div>
|
||||
<div class="line"><span class="lineno"> 1081</span> int8_t child_index = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChildIndex(next_node);</div>
|
||||
<div class="line"><span class="lineno"> 1082</span> <span class="keywordflow">if</span> (child_index > 0) {</div>
|
||||
<div class="line"><span class="lineno"> 1083</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, child_index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1083</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, child_index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 1084</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 1085</span> <a class="code hl_class" href="../../d5/da1/structnode.html">node</a> = <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>, child_index);</div>
|
||||
<div class="line"><span class="lineno"> 1085</span> <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a> = <a class="code hl_function" href="#a36f4d5f603f7edb7db7c73fb53ba14e9">Merge</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>, child_index);</div>
|
||||
<div class="line"><span class="lineno"> 1086</span> }</div>
|
||||
<div class="line"><span class="lineno"> 1087</span> </div>
|
||||
<div class="line"><span class="lineno"> 1088</span> } <span class="comment">// while</span></div>
|
||||
@@ -1307,7 +1305,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1324,8 +1322,8 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00845">845</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 845</span> {</div>
|
||||
<div class="line"><span class="lineno"> 846</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left = parent->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 847</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right = parent->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 846</span> Node *left = parent->GetItemLeftChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 847</span> Node *right = parent->GetItemRightChild(index);</div>
|
||||
<div class="line"><span class="lineno"> 848</span> </div>
|
||||
<div class="line"><span class="lineno"> 849</span> assert(left && left->Is34Node());</div>
|
||||
<div class="line"><span class="lineno"> 850</span> assert(right && right->Is2Node());</div>
|
||||
@@ -1356,7 +1354,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1372,15 +1370,15 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00745">745</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 745</span> {</div>
|
||||
<div class="line"><span class="lineno"> 746</span> assert(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetCount() == 3);</div>
|
||||
<div class="line"><span class="lineno"> 746</span> assert(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetCount() == 3);</div>
|
||||
<div class="line"><span class="lineno"> 747</span> </div>
|
||||
<div class="line"><span class="lineno"> 748</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 748</span> Node *left = <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>;</div>
|
||||
<div class="line"><span class="lineno"> 749</span> </div>
|
||||
<div class="line"><span class="lineno"> 750</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right = <span class="keyword">new</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>->GetItem(2));</div>
|
||||
<div class="line"><span class="lineno"> 751</span> right->SetChild(0, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(2));</div>
|
||||
<div class="line"><span class="lineno"> 752</span> right->SetChild(1, <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(3));</div>
|
||||
<div class="line"><span class="lineno"> 750</span> Node *right = <span class="keyword">new</span> Node(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(2));</div>
|
||||
<div class="line"><span class="lineno"> 751</span> right->SetChild(0, <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(2));</div>
|
||||
<div class="line"><span class="lineno"> 752</span> right->SetChild(1, <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(3));</div>
|
||||
<div class="line"><span class="lineno"> 753</span> </div>
|
||||
<div class="line"><span class="lineno"> 754</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *parent = <span class="keyword">new</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>->GetItem(1));</div>
|
||||
<div class="line"><span class="lineno"> 754</span> Node *parent = <span class="keyword">new</span> Node(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(1));</div>
|
||||
<div class="line"><span class="lineno"> 755</span> parent->SetChild(0, left);</div>
|
||||
<div class="line"><span class="lineno"> 756</span> parent->SetChild(1, right);</div>
|
||||
<div class="line"><span class="lineno"> 757</span> </div>
|
||||
@@ -1442,7 +1440,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1457,17 +1455,17 @@ Private Attributes</h2></td></tr>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../db/dbc/tree__234_8cpp_source.html#l00567">567</a> of file <a class="el" href="../../db/dbc/tree__234_8cpp_source.html">tree_234.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 567</span> {</div>
|
||||
<div class="line"><span class="lineno"> 568</span> <span class="keywordflow">if</span> (!<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 568</span> <span class="keywordflow">if</span> (!<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>) {</div>
|
||||
<div class="line"><span class="lineno"> 569</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 570</span> }</div>
|
||||
<div class="line"><span class="lineno"> 571</span> </div>
|
||||
<div class="line"><span class="lineno"> 572</span> int8_t i = 0;</div>
|
||||
<div class="line"><span class="lineno"> 573</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetCount(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 574</span> <a class="code hl_function" href="#a84ab7b4fe7442b5e2eeed8c050bb86bd">Traverse</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(i));</div>
|
||||
<div class="line"><span class="lineno"> 575</span> std::cout << <a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetItem(i) << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 573</span> <span class="keywordflow">for</span> (i = 0; i < <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetCount(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 574</span> <a class="code hl_function" href="#a84ab7b4fe7442b5e2eeed8c050bb86bd">Traverse</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(i));</div>
|
||||
<div class="line"><span class="lineno"> 575</span> std::cout << <a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetItem(i) << <span class="stringliteral">", "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 576</span> }</div>
|
||||
<div class="line"><span class="lineno"> 577</span> </div>
|
||||
<div class="line"><span class="lineno"> 578</span> <a class="code hl_function" href="#a84ab7b4fe7442b5e2eeed8c050bb86bd">Traverse</a>(<a class="code hl_class" href="../../d5/da1/structnode.html">node</a>->GetChild(i));</div>
|
||||
<div class="line"><span class="lineno"> 578</span> <a class="code hl_function" href="#a84ab7b4fe7442b5e2eeed8c050bb86bd">Traverse</a>(<a class="code hl_typedef" href="../../d8/dee/avltree_8cpp.html#a74f0cf18a0e5b832d9994e2f2d022287">node</a>->GetChild(i));</div>
|
||||
<div class="line"><span class="lineno"> 579</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -1494,7 +1492,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1519,7 +1517,7 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 783</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 784</span> }</div>
|
||||
<div class="line"><span class="lineno"> 785</span> </div>
|
||||
<div class="line"><span class="lineno"> 786</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *right_sibling = parent->GetChild(to_child_index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 786</span> Node *right_sibling = parent->GetChild(to_child_index + 1);</div>
|
||||
<div class="line"><span class="lineno"> 787</span> </div>
|
||||
<div class="line"><span class="lineno"> 788</span> <span class="comment">// right sibling is 2-node. can not do left rotate.</span></div>
|
||||
<div class="line"><span class="lineno"> 789</span> <span class="keywordflow">if</span> (right_sibling->Is2Node()) {</div>
|
||||
@@ -1555,7 +1553,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1580,7 +1578,7 @@ Private Attributes</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 818</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 819</span> }</div>
|
||||
<div class="line"><span class="lineno"> 820</span> </div>
|
||||
<div class="line"><span class="lineno"> 821</span> <a class="code hl_class" href="../../db/d8b/struct_node.html">Node</a> *left_sibling = parent->GetChild(to_child_index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 821</span> Node *left_sibling = parent->GetChild(to_child_index - 1);</div>
|
||||
<div class="line"><span class="lineno"> 822</span> </div>
|
||||
<div class="line"><span class="lineno"> 823</span> <span class="comment">// right sibling is 2-node. can not do left rotate.</span></div>
|
||||
<div class="line"><span class="lineno"> 824</span> <span class="keywordflow">if</span> (left_sibling->Is2Node()) {</div>
|
||||
@@ -1610,7 +1608,7 @@ Private Attributes</h2></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel private">private</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -1631,7 +1629,7 @@ Private Attributes</h2></td></tr>
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d5/d3c/namespacedata__structures.html">data_structures</a></li><li class="navelem"><b>tree_234</b></li><li class="navelem"><a class="el" href="../../d3/d95/classdata__structures_1_1tree__234_1_1_tree234.html">Tree234</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -144,7 +144,7 @@ $(function(){initNavTree('dc/d93/classmachine__learning_1_1neural__network_1_1la
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -133,7 +133,7 @@ $(function(){initNavTree('da/d21/class_longest___substring.html','../../'); init
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -134,7 +134,7 @@ $(function(){initNavTree('d5/d8a/classothers_1_1postfix__expression_1_1_stack.ht
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: n_queens Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d3/da1/namespacen__queens.html','../../'); initResizab
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d3/da1/namespacen__queens.html">n_queens</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -141,7 +141,7 @@ $(function(){initNavTree('d8/dab/classstatistics_1_1stats__computer2.html','../.
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: Member List</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -134,7 +134,7 @@ $(function(){initNavTree('d7/d48/structgeometry_1_1grahamscan_1_1_point.html','.
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: binary_search_tree< T > Pages: 1 -->
|
||||
<svg width="248pt" height="128pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: binary_search_tree< T > Pages: 1 -->
|
||||
<svg width="248pt" height="128pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures::sparse_table::Sparse_table Pages: 1 -->
|
||||
<svg width="197pt" height="183pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: data_structures::sparse_table::Sparse_table Pages: 1 -->
|
||||
<svg width="197pt" height="183pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/dsu_path_compression.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -222,7 +222,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -268,7 +268,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -302,7 +302,7 @@ element). Disjoint sets uses cases : for finding connected components in a graph
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../d3/dae/dsu__path__compression_8cpp.html">dsu_path_compression.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: data_structures/dsu_path_compression.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,7 +124,8 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="headertitle"><div class="title">dsu_path_compression.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../d3/dae/dsu__path__compression_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="../../d3/dae/dsu__path__compression_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 <cassert></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
@@ -133,9 +134,9 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">using </span>std::cout;</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">using </span>std::endl;</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">using </span>std::vector;</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span></div>
|
||||
<div class="foldopen" id="foldopen00034" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html"> 34</a></span><span class="keyword">class </span><a class="code hl_class" href="../../dd/d1f/classdsu.html">dsu</a> {</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html"> 34</a></span><span class="keyword">class </span><a class="code hl_function" href="../../dd/d1f/classdsu.html#a126e3002a464e53cd54b07ba56482a72">dsu</a> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb"> 36</a></span> vector<uint64_t> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>; </div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429"> 37</a></span> vector<uint64_t> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>; </div>
|
||||
@@ -163,7 +164,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> }</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</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="foldopen00074" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c"> 74</a></span> uint64_t <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(uint64_t i) {</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] == i) {</div>
|
||||
@@ -172,6 +173,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">return</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i] = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[i]));</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a6ac30c07abca2aaa3b291504c25c3559"> 88</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/d1f/classdsu.html#a6ac30c07abca2aaa3b291504c25c3559">UnionSet</a>(uint64_t i, uint64_t j) {</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a>(i, j)) {</div>
|
||||
@@ -181,12 +183,12 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// we find the representative of the i and j</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> uint64_t x = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i);</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> uint64_t y = <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j);</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="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] > <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> std::swap(x, y);</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1ef0b0462a0dda63514f641cbb7dd8cb">p</a>[x] = y;</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span></div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[x] == <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]) {</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4bf54d33fba178998dbbe4c57f2e9429">depth</a>[y]++;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
|
||||
@@ -195,6 +197,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[y] = std::min(<a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[x], <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[y]);</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span></div>
|
||||
<div class="foldopen" id="foldopen00124" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303"> 124</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dd/d1f/classdsu.html#a64d25c5986742f7c234ed449b2ff7303">isSame</a>(uint64_t i, uint64_t j) {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i) == <a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(j)) {</div>
|
||||
@@ -203,6 +206,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span></div>
|
||||
<div class="foldopen" id="foldopen00136" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a0ce2672c570f4235eafddb0c9a58115a"> 136</a></span> vector<uint64_t> <a class="code hl_function" href="../../dd/d1f/classdsu.html#a0ce2672c570f4235eafddb0c9a58115a">get</a>(uint64_t i) {</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> vector<uint64_t> ans;</div>
|
||||
@@ -212,12 +216,13 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">return</span> ans;</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span></div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c"> 149</a></span> uint64_t <a class="code hl_function" href="../../dd/d1f/classdsu.html#a1c24228b0f2f49220133fb8c3566a55c">size</a>(uint64_t i) { <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#ac0dc3e17e49fe19b159b4ea4096d7b55">setSize</a>[<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i)]; }</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde"> 156</a></span> uint64_t <a class="code hl_function" href="../../dd/d1f/classdsu.html#a696141b8b092466767f4bfe1c5e46cde">get_max</a>(uint64_t i) { <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a4ade6f16c418fc98b54452f7b0252a53">maxElement</a>[<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i)]; }</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"><a class="line" href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415"> 163</a></span> uint64_t <a class="code hl_function" href="../../dd/d1f/classdsu.html#ac713a5b496d0405c82e2808a85e58415">get_min</a>(uint64_t i) { <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dd/d1f/classdsu.html#a1d77aad7fc39fe7140d834cd347e5c63">minElement</a>[<a class="code hl_function" href="../../dd/d1f/classdsu.html#a16851f78fe390fc1430905c83d6a2f1c">findSet</a>(i)]; }</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> </div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span></div>
|
||||
<div class="foldopen" id="foldopen00170" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"><a class="line" href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243"> 170</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#ae7880ce913f3058a35ff106d5be9e243">test1</a>() {</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
@@ -233,6 +238,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> cout << <span class="stringliteral">"1st test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span></div>
|
||||
<div class="foldopen" id="foldopen00187" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"><a class="line" href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae"> 187</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#a45d94ead4cf4e1ff9f87c38bc99f59ae">test2</a>() {</div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="comment">// the minimum, maximum, and size of the set</span></div>
|
||||
@@ -249,7 +255,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_8cpp_source.html','../..
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> cout << <span class="stringliteral">"2nd test passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> </div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</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="../../d3/dae/dsu__path__compression_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 206</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d3/dae/dsu__path__compression_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> uint64_t n = 10; </div>
|
||||
@@ -285,7 +291,7 @@ $(function(){initNavTree('d3/dae/dsu__path__compression_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="../../d3/dae/dsu__path__compression_8cpp.html">dsu_path_compression.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/stooge_sort.cpp Pages: 1 -->
|
||||
<svg width="263pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.2.0 (20241103.1931)
|
||||
<!-- Generated by graphviz version 12.2.1 (20241206.2353)
|
||||
-->
|
||||
<!-- Title: sorting/stooge_sort.cpp Pages: 1 -->
|
||||
<svg width="263pt" height="83pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: linked_list Namespace Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -135,7 +135,7 @@ $(function(){initNavTree('d3/db0/namespacelinked__list.html','../../'); initResi
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d3/db0/namespacelinked__list.html">linked_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>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: strings/boyer_moore.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -266,7 +266,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 228</span>}</div>
|
||||
<div class="ttc" id="anamespacestrings_1_1boyer__moore_html_a056122c8fe8fb0f5fca6428d3f7b5c3a"><div class="ttname"><a href="../../d0/dbc/namespacestrings_1_1boyer__moore.html#a056122c8fe8fb0f5fca6428d3f7b5c3a">strings::boyer_moore::is_prefix</a></div><div class="ttdeci">bool is_prefix(const char *str, const char *pat, size_t len)</div><div class="ttdoc">Check if pat is prefix of str.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00200">boyer_moore.cpp:200</a></div></div>
|
||||
<div class="ttc" id="anamespacestrings_1_1boyer__moore_html_a0b165af1dc341289fd705be4c67728f8"><div class="ttname"><a href="../../d0/dbc/namespacestrings_1_1boyer__moore.html#a0b165af1dc341289fd705be4c67728f8">strings::boyer_moore::init_pattern</a></div><div class="ttdeci">void init_pattern(const std::string &str, pattern &arg)</div><div class="ttdoc">A function that initializes pattern.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00153">boyer_moore.cpp:153</a></div></div>
|
||||
<div class="ttc" id="anamespacestrings_1_1boyer__moore_html_a15703b553faed0d28202c10808cf9738"><div class="ttname"><a href="../../d0/dbc/namespacestrings_1_1boyer__moore.html#a15703b553faed0d28202c10808cf9738">strings::boyer_moore::search</a></div><div class="ttdeci">std::vector< size_t > search(const std::string &str, const pattern &arg)</div><div class="ttdoc">A function that implements Boyer-Moore's algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00165">boyer_moore.cpp:165</a></div></div>
|
||||
<div class="ttc" id="anamespacestrings_1_1boyer__moore_html_a15703b553faed0d28202c10808cf9738"><div class="ttname"><a href="../../d0/dbc/namespacestrings_1_1boyer__moore.html#a15703b553faed0d28202c10808cf9738">strings::boyer_moore::search</a></div><div class="ttdeci">std::vector< size_t > search(const std::string &str, const pattern &arg)</div><div class="ttdoc">A function that implements Boyer-Moore's algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00165">boyer_moore.cpp:165</a></div></div>
|
||||
<div class="ttc" id="astructstrings_1_1boyer__moore_1_1pattern_html"><div class="ttname"><a href="../../dd/d5a/structstrings_1_1boyer__moore_1_1pattern.html">strings::boyer_moore::pattern</a></div><div class="ttdoc">A structure representing all the data we need to search the preprocessed pattern in text.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00070">boyer_moore.cpp:70</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
@@ -355,7 +355,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">
|
||||
@@ -378,8 +378,8 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 261</span> </div>
|
||||
<div class="line"><span class="lineno"> 262</span> std::cout << <span class="stringliteral">"All tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 263</span>}</div>
|
||||
<div class="ttc" id="aboyer__moore_8cpp_html_ac8fac0dd4b19973da103a434143a16d2"><div class="ttname"><a href="#ac8fac0dd4b19973da103a434143a16d2">pat_test</a></div><div class="ttdeci">void pat_test(const char *text)</div><div class="ttdoc">A test case in which we search for every appearance of the word 'pat'.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00235">boyer_moore.cpp:235</a></div></div>
|
||||
<div class="ttc" id="aboyer__moore_8cpp_html_acb8f69e7901ee7459d98bd4b9dda79d9"><div class="ttname"><a href="#acb8f69e7901ee7459d98bd4b9dda79d9">and_test</a></div><div class="ttdeci">void and_test(const char *text)</div><div class="ttdoc">A test case in which we search for every appearance of the word 'and'.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00220">boyer_moore.cpp:220</a></div></div>
|
||||
<div class="ttc" id="aboyer__moore_8cpp_html_ac8fac0dd4b19973da103a434143a16d2"><div class="ttname"><a href="#ac8fac0dd4b19973da103a434143a16d2">pat_test</a></div><div class="ttdeci">void pat_test(const char *text)</div><div class="ttdoc">A test case in which we search for every appearance of the word 'pat'.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00235">boyer_moore.cpp:235</a></div></div>
|
||||
<div class="ttc" id="aboyer__moore_8cpp_html_acb8f69e7901ee7459d98bd4b9dda79d9"><div class="ttname"><a href="#acb8f69e7901ee7459d98bd4b9dda79d9">and_test</a></div><div class="ttdeci">void and_test(const char *text)</div><div class="ttdoc">A test case in which we search for every appearance of the word 'and'.</div><div class="ttdef"><b>Definition</b> <a href="../../d3/db2/boyer__moore_8cpp_source.html#l00220">boyer_moore.cpp:220</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -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_73a3cc5065b223eb41b02873c0e19f0e.html">strings</a></li><li class="navelem"><a class="el" href="../../d3/db2/boyer__moore_8cpp.html">boyer_moore.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>
|
||||
|
||||