Documentation for 0d766b0f8a
@@ -194,7 +194,7 @@ Functions</h2></td></tr>
|
||||
<div class="line"><span class="lineno"> 151</span> print(mdist, V);</div>
|
||||
<div class="line"><span class="lineno"> 152</span>}</div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
<div class="ttc" id="anamespacegreedy__algorithms_1_1dijkstra_html_af6cb29ca6dc5771439f6ea7262058a71"><div class="ttname"><a href="#af6cb29ca6dc5771439f6ea7262058a71">greedy_algorithms::dijkstra::minimum_distance</a></div><div class="ttdeci">int minimum_distance(std::vector< int > mdist, std::vector< bool > vset, int V)</div><div class="ttdoc">Utility function that finds the vertex with the minimum distance in mdist.</div><div class="ttdef"><b>Definition</b> dijkstra.cpp:82</div></div>
|
||||
<div class="ttc" id="anamespacegreedy__algorithms_1_1dijkstra_html_af6cb29ca6dc5771439f6ea7262058a71"><div class="ttname"><a href="#af6cb29ca6dc5771439f6ea7262058a71">greedy_algorithms::dijkstra::minimum_distance</a></div><div class="ttdeci">int minimum_distance(std::vector< int > mdist, std::vector< bool > vset, int V)</div><div class="ttdoc">Utility function that finds the vertex with the minimum distance in mdist.</div><div class="ttdef"><b>Definition</b> dijkstra_greedy.cpp:82</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
|
||||
@@ -114,12 +114,13 @@ $(function(){initNavTree('d2/d45/segtree_8cpp.html','../../'); initResizable(tru
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cmath></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for segtree.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/db6/segtree_8cpp__incl.svg" width="334" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../de/db6/segtree_8cpp__incl.svg" width="418" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
@@ -190,7 +191,7 @@ Functions</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> </p>
|
||||
<p>for assert for log2 for IO operations</p>
|
||||
<p>for assert for log2 for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> for IO operations</p>
|
||||
<p>Constructs the initial segment tree</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
@@ -203,18 +204,18 @@ Functions</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 38</span> {</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordflow">if</span> (low == high) {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> (*segtree)[pos] = arr[low];</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 42</span> }</div>
|
||||
<div class="line"><span class="lineno"> 43</span> </div>
|
||||
<div class="line"><span class="lineno"> 44</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 47</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><span class="lineno"> 48</span>}</div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_ae752659b7c1719d68fdb2ca538a93696"><div class="ttname"><a href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a></div><div class="ttdeci">void ConsTree(const std::vector< int64_t > &arr, std::vector< int64_t > *segtree, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition</b> segtree.cpp:37</div></div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 39</span> {</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">if</span> (low == high) {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> (*segtree)[pos] = arr[low];</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><span class="lineno"> 45</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, segtree, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 48</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><span class="lineno"> 49</span>}</div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_ae752659b7c1719d68fdb2ca538a93696"><div class="ttname"><a href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a></div><div class="ttdeci">void ConsTree(const std::vector< int64_t > &arr, std::vector< int64_t > *segtree, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">for std::vector</div><div class="ttdef"><b>Definition</b> segtree.cpp:38</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -240,66 +241,66 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 167</span> {</div>
|
||||
<div class="line"><span class="lineno"> 168</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><span class="lineno"> 170</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter number of elements: "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 171</span> </div>
|
||||
<div class="line"><span class="lineno"> 172</span> uint64_t n = 0;</div>
|
||||
<div class="line"><span class="lineno"> 173</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> n;</div>
|
||||
<div class="line"><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><span class="lineno"> 175</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>uint64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(n))) - 1);</div>
|
||||
<div class="line"><span class="lineno"> 176</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr(n), lazy(max), segtree(max);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> </div>
|
||||
<div class="line"><span class="lineno"> 178</span> <span class="keywordtype">int</span> choice = 0;</div>
|
||||
<div class="line"><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nDo you wish to enter each number?:\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 180</span> <span class="stringliteral">"1: Yes\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="stringliteral">"0: No (default initialize them to 0)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 182</span> </div>
|
||||
<div class="line"><span class="lineno"> 183</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><span class="lineno"> 184</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter "</span> << n << <span class="stringliteral">" numbers:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << i << <span class="stringliteral">": "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 188</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 189</span> }</div>
|
||||
<div class="line"><span class="lineno"> 190</span> }</div>
|
||||
<div class="line"><span class="lineno"> 191</span> </div>
|
||||
<div class="line"><span class="lineno"> 192</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 193</span> </div>
|
||||
<div class="line"><span class="lineno"> 194</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><span class="lineno"> 195</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nMake your choice:\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 196</span> <span class="stringliteral">"1: Range update (input)\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span> <span class="stringliteral">"2: Range query (output)\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="stringliteral">"0: Exit\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 199</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><span class="lineno"> 200</span> </div>
|
||||
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter 1-indexed lower bound, upper bound & value:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 203</span> </div>
|
||||
<div class="line"><span class="lineno"> 204</span> uint64_t p = 1, q = 1, v = 0;</div>
|
||||
<div class="line"><span class="lineno"> 205</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q >> v;</div>
|
||||
<div class="line"><span class="lineno"> 206</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, p - 1, q - 1, v, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 207</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (choice == 2) {</div>
|
||||
<div class="line"><span class="lineno"> 208</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter 1-indexed lower bound & upper bound:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 209</span> </div>
|
||||
<div class="line"><span class="lineno"> 210</span> uint64_t p = 1, q = 1;</div>
|
||||
<div class="line"><span class="lineno"> 211</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q;</div>
|
||||
<div class="line"><span class="lineno"> 212</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, p - 1, q - 1, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 213</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 214</span> }</div>
|
||||
<div class="line"><span class="lineno"> 215</span> } <span class="keywordflow">while</span> (choice > 0);</div>
|
||||
<div class="line"><span class="lineno"> 216</span> </div>
|
||||
<div class="line"><span class="lineno"> 217</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 218</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 168</span> {</div>
|
||||
<div class="line"><span class="lineno"> 169</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 170</span> </div>
|
||||
<div class="line"><span class="lineno"> 171</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter number of elements: "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 172</span> </div>
|
||||
<div class="line"><span class="lineno"> 173</span> uint64_t n = 0;</div>
|
||||
<div class="line"><span class="lineno"> 174</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> n;</div>
|
||||
<div class="line"><span class="lineno"> 175</span> </div>
|
||||
<div class="line"><span class="lineno"> 176</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>uint64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(n))) - 1);</div>
|
||||
<div class="line"><span class="lineno"> 177</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr(n), lazy(max), segtree(max);</div>
|
||||
<div class="line"><span class="lineno"> 178</span> </div>
|
||||
<div class="line"><span class="lineno"> 179</span> <span class="keywordtype">int</span> choice = 0;</div>
|
||||
<div class="line"><span class="lineno"> 180</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nDo you wish to enter each number?:\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 181</span> <span class="stringliteral">"1: Yes\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 182</span> <span class="stringliteral">"0: No (default initialize them to 0)\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 183</span> </div>
|
||||
<div class="line"><span class="lineno"> 184</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><span class="lineno"> 185</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 186</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter "</span> << n << <span class="stringliteral">" numbers:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 187</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i <= n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 188</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << i << <span class="stringliteral">": "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 189</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> arr[i];</div>
|
||||
<div class="line"><span class="lineno"> 190</span> }</div>
|
||||
<div class="line"><span class="lineno"> 191</span> }</div>
|
||||
<div class="line"><span class="lineno"> 192</span> </div>
|
||||
<div class="line"><span class="lineno"> 193</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 194</span> </div>
|
||||
<div class="line"><span class="lineno"> 195</span> <span class="keywordflow">do</span> {</div>
|
||||
<div class="line"><span class="lineno"> 196</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\nMake your choice:\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 197</span> <span class="stringliteral">"1: Range update (input)\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 198</span> <span class="stringliteral">"2: Range query (output)\n"</span></div>
|
||||
<div class="line"><span class="lineno"> 199</span> <span class="stringliteral">"0: Exit\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 200</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> choice;</div>
|
||||
<div class="line"><span class="lineno"> 201</span> </div>
|
||||
<div class="line"><span class="lineno"> 202</span> <span class="keywordflow">if</span> (choice == 1) {</div>
|
||||
<div class="line"><span class="lineno"> 203</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter 1-indexed lower bound, upper bound & value:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 204</span> </div>
|
||||
<div class="line"><span class="lineno"> 205</span> uint64_t p = 1, q = 1, v = 0;</div>
|
||||
<div class="line"><span class="lineno"> 206</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q >> v;</div>
|
||||
<div class="line"><span class="lineno"> 207</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, p - 1, q - 1, v, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 208</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (choice == 2) {</div>
|
||||
<div class="line"><span class="lineno"> 209</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Enter 1-indexed lower bound & upper bound:\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 210</span> </div>
|
||||
<div class="line"><span class="lineno"> 211</span> uint64_t p = 1, q = 1;</div>
|
||||
<div class="line"><span class="lineno"> 212</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> p >> q;</div>
|
||||
<div class="line"><span class="lineno"> 213</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, p - 1, q - 1, 0, n - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 214</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 215</span> }</div>
|
||||
<div class="line"><span class="lineno"> 216</span> } <span class="keywordflow">while</span> (choice > 0);</div>
|
||||
<div class="line"><span class="lineno"> 217</span> </div>
|
||||
<div class="line"><span class="lineno"> 218</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 219</span>}</div>
|
||||
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aceil_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">std::ceil</a></div><div class="ttdeci">T ceil(T... args)</div></div>
|
||||
<div class="ttc" id="amax_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/max.html">std::max</a></div><div class="ttdeci">T max(T... args)</div></div>
|
||||
<div class="ttc" id="apow_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">std::pow</a></div><div class="ttdeci">T pow(T... args)</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_a423a97ea0c7ea6e33b5844a6858d902d"><div class="ttname"><a href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a></div><div class="ttdeci">int64_t query(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, uint64_t qlow, uint64_t qhigh, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Returns the sum of all elements in a range.</div><div class="ttdef"><b>Definition</b> segtree.cpp:62</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementation.</div><div class="ttdef"><b>Definition</b> segtree.cpp:146</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_abd3e818681fb2e29cf08f4f60f82c8e0"><div class="ttname"><a href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a></div><div class="ttdeci">void update(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, int64_t start, int64_t end, int64_t delta, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Updates a range of the segment tree.</div><div class="ttdef"><b>Definition</b> segtree.cpp:102</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_a423a97ea0c7ea6e33b5844a6858d902d"><div class="ttname"><a href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a></div><div class="ttdeci">int64_t query(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, uint64_t qlow, uint64_t qhigh, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Returns the sum of all elements in a range.</div><div class="ttdef"><b>Definition</b> segtree.cpp:63</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementation.</div><div class="ttdef"><b>Definition</b> segtree.cpp:147</div></div>
|
||||
<div class="ttc" id="asegtree_8cpp_html_abd3e818681fb2e29cf08f4f60f82c8e0"><div class="ttname"><a href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a></div><div class="ttdeci">void update(std::vector< int64_t > *segtree, std::vector< int64_t > *lazy, int64_t start, int64_t end, int64_t delta, uint64_t low, uint64_t high, uint64_t pos)</div><div class="ttdoc">Updates a range of the segment tree.</div><div class="ttdef"><b>Definition</b> segtree.cpp:103</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
@@ -367,30 +368,30 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>result of the range query for this function call </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 64</span> {</div>
|
||||
<div class="line"><span class="lineno"> 65</span> <span class="keywordflow">if</span> (low > high || qlow > high || low > qhigh) {</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 67</span> }</div>
|
||||
<div class="line"><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 70</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 73</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 74</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 75</span> }</div>
|
||||
<div class="line"><span class="lineno"> 76</span> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 77</span> }</div>
|
||||
<div class="line"><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">if</span> (qlow <= low && qhigh >= high) {</div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="keywordflow">return</span> (*segtree)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 81</span> }</div>
|
||||
<div class="line"><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><span class="lineno"> 83</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 84</span> </div>
|
||||
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, low, mid, 2 * pos + 1) +</div>
|
||||
<div class="line"><span class="lineno"> 86</span> <a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 87</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 65</span> {</div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">if</span> (low > high || qlow > high || low > qhigh) {</div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 68</span> }</div>
|
||||
<div class="line"><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 71</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 74</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 75</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 76</span> }</div>
|
||||
<div class="line"><span class="lineno"> 77</span> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 78</span> }</div>
|
||||
<div class="line"><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="keywordflow">if</span> (qlow <= low && qhigh >= high) {</div>
|
||||
<div class="line"><span class="lineno"> 81</span> <span class="keywordflow">return</span> (*segtree)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 82</span> }</div>
|
||||
<div class="line"><span class="lineno"> 83</span> </div>
|
||||
<div class="line"><span class="lineno"> 84</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 85</span> </div>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, low, mid, 2 * pos + 1) +</div>
|
||||
<div class="line"><span class="lineno"> 87</span> <a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(segtree, lazy, qlow, qhigh, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 88</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -424,21 +425,21 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Self-test implementation. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 146</span> {</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>int64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(7))) - 1);</div>
|
||||
<div class="line"><span class="lineno"> 148</span> assert(max == 15);</div>
|
||||
<div class="line"><span class="lineno"> 149</span> </div>
|
||||
<div class="line"><span class="lineno"> 150</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr{1, 2, 3, 4, 5, 6, 7}, lazy(max), segtree(max);</div>
|
||||
<div class="line"><span class="lineno"> 151</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 152</span> </div>
|
||||
<div class="line"><span class="lineno"> 153</span> assert(<a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 3 + 4 + 5 + 6);</div>
|
||||
<div class="line"><span class="lineno"> 154</span> </div>
|
||||
<div class="line"><span class="lineno"> 155</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 2, 4, 1, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 156</span> assert(<a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 4 + 5 + 6 + 6);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><span class="lineno"> 158</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 0, 6, -2, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 159</span> assert(<a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 0, 4, 0, 7 - 1, 0) == -1 + 0 + 2 + 3 + 4);</div>
|
||||
<div class="line"><span class="lineno"> 160</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 147</span> {</div>
|
||||
<div class="line"><span class="lineno"> 148</span> <span class="keyword">auto</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/max.html">max</a> = <span class="keyword">static_cast<</span>int64_t<span class="keyword">></span>(2 * <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/pow.html">pow</a>(2, <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/ceil.html">ceil</a>(log2(7))) - 1);</div>
|
||||
<div class="line"><span class="lineno"> 149</span> assert(max == 15);</div>
|
||||
<div class="line"><span class="lineno"> 150</span> </div>
|
||||
<div class="line"><span class="lineno"> 151</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> arr{1, 2, 3, 4, 5, 6, 7}, lazy(max), segtree(max);</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <a class="code hl_function" href="#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a>(arr, &segtree, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 153</span> </div>
|
||||
<div class="line"><span class="lineno"> 154</span> assert(<a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 3 + 4 + 5 + 6);</div>
|
||||
<div class="line"><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><span class="lineno"> 156</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 2, 4, 1, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 157</span> assert(<a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 1, 5, 0, 7 - 1, 0) == 2 + 4 + 5 + 6 + 6);</div>
|
||||
<div class="line"><span class="lineno"> 158</span> </div>
|
||||
<div class="line"><span class="lineno"> 159</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(&segtree, &lazy, 0, 6, -2, 0, 7 - 1, 0);</div>
|
||||
<div class="line"><span class="lineno"> 160</span> assert(<a class="code hl_function" href="#a423a97ea0c7ea6e33b5844a6858d902d">query</a>(&segtree, &lazy, 0, 4, 0, 7 - 1, 0) == -1 + 0 + 2 + 3 + 4);</div>
|
||||
<div class="line"><span class="lineno"> 161</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
@@ -511,42 +512,42 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 104</span> {</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">if</span> (low > high) {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 107</span> }</div>
|
||||
<div class="line"><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><span class="lineno"> 109</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 110</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 113</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 114</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 115</span> }</div>
|
||||
<div class="line"><span class="lineno"> 116</span> (*lazy)[pos] = 0;</div>
|
||||
<div class="line"><span class="lineno"> 117</span> }</div>
|
||||
<div class="line"><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><span class="lineno"> 119</span> <span class="keywordflow">if</span> (start > high || end < low) {</div>
|
||||
<div class="line"><span class="lineno"> 120</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 121</span> }</div>
|
||||
<div class="line"><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="keywordflow">if</span> (start <= low && end >= high) {</div>
|
||||
<div class="line"><span class="lineno"> 124</span> (*segtree)[pos] += delta * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 125</span> </div>
|
||||
<div class="line"><span class="lineno"> 126</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 127</span> (*lazy)[2 * pos + 1] += delta;</div>
|
||||
<div class="line"><span class="lineno"> 128</span> (*lazy)[2 * pos + 2] += delta;</div>
|
||||
<div class="line"><span class="lineno"> 129</span> }</div>
|
||||
<div class="line"><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 132</span> }</div>
|
||||
<div class="line"><span class="lineno"> 133</span> </div>
|
||||
<div class="line"><span class="lineno"> 134</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><span class="lineno"> 136</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><span class="lineno"> 139</span>}</div>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 105</span> {</div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">if</span> (low > high) {</div>
|
||||
<div class="line"><span class="lineno"> 107</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 108</span> }</div>
|
||||
<div class="line"><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">if</span> ((*lazy)[pos] != 0) {</div>
|
||||
<div class="line"><span class="lineno"> 111</span> (*segtree)[pos] += (*lazy)[pos] * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><span class="lineno"> 113</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 114</span> (*lazy)[2 * pos + 1] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 115</span> (*lazy)[2 * pos + 2] += (*lazy)[pos];</div>
|
||||
<div class="line"><span class="lineno"> 116</span> }</div>
|
||||
<div class="line"><span class="lineno"> 117</span> (*lazy)[pos] = 0;</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"> 120</span> <span class="keywordflow">if</span> (start > high || end < low) {</div>
|
||||
<div class="line"><span class="lineno"> 121</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 122</span> }</div>
|
||||
<div class="line"><span class="lineno"> 123</span> </div>
|
||||
<div class="line"><span class="lineno"> 124</span> <span class="keywordflow">if</span> (start <= low && end >= high) {</div>
|
||||
<div class="line"><span class="lineno"> 125</span> (*segtree)[pos] += delta * (high - low + 1);</div>
|
||||
<div class="line"><span class="lineno"> 126</span> </div>
|
||||
<div class="line"><span class="lineno"> 127</span> <span class="keywordflow">if</span> (low != high) {</div>
|
||||
<div class="line"><span class="lineno"> 128</span> (*lazy)[2 * pos + 1] += delta;</div>
|
||||
<div class="line"><span class="lineno"> 129</span> (*lazy)[2 * pos + 2] += delta;</div>
|
||||
<div class="line"><span class="lineno"> 130</span> }</div>
|
||||
<div class="line"><span class="lineno"> 131</span> </div>
|
||||
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><span class="lineno"> 133</span> }</div>
|
||||
<div class="line"><span class="lineno"> 134</span> </div>
|
||||
<div class="line"><span class="lineno"> 135</span> uint64_t mid = (low + high) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, low, mid, 2 * pos + 1);</div>
|
||||
<div class="line"><span class="lineno"> 138</span> <a class="code hl_function" href="#abd3e818681fb2e29cf08f4f60f82c8e0">update</a>(segtree, lazy, start, end, delta, mid + 1, high, 2 * pos + 2);</div>
|
||||
<div class="line"><span class="lineno"> 139</span> (*segtree)[pos] = (*segtree)[2 * pos + 1] + (*segtree)[2 * pos + 2];</div>
|
||||
<div class="line"><span class="lineno"> 140</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<map id="greedy_algorithms/dijkstra.cpp" name="greedy_algorithms/dijkstra.cpp">
|
||||
<area shape="rect" id="Node000001" title="Dijkstra algorithm implementation" alt="" coords="68,5,266,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,70,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="146,34,74,73,72,69,144,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="93,79,152,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="162,33,141,67,136,64,157,30"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="176,79,248,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="177,30,199,64,194,67,172,33"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="272,79,329,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="191,29,265,69,263,74,188,34"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
02dec7afa6ff871d850c576454a9fbec
|
||||
@@ -1,93 +0,0 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms/dijkstra.cpp Pages: 1 -->
|
||||
<svg width="251pt" height="83pt"
|
||||
viewBox="0.00 0.00 250.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 78.5)">
|
||||
<title>greedy_algorithms/dijkstra.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Dijkstra algorithm implementation">
|
||||
<polygon fill="#999999" stroke="#666666" points="195.5,-74.5 46.75,-74.5 46.75,-55.25 195.5,-55.25 195.5,-74.5"/>
|
||||
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms/dijkstra.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="48.25,-19.25 0,-19.25 0,0 48.25,0 48.25,-19.25"/>
|
||||
<text text-anchor="middle" x="24.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M104.67,-54.84C89.9,-46.73 67.95,-34.68 50.69,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.44,-22.18 41.99,-20.43 49.07,-28.31 52.44,-22.18"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="110.38,-19.25 65.88,-19.25 65.88,0 110.38,0 110.38,-19.25"/>
|
||||
<text text-anchor="middle" x="88.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">climits</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M115.68,-55.08C111.35,-48.11 105.16,-38.12 99.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.73,-27.55 94.49,-20.9 96.78,-31.24 102.73,-27.55"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="181.88,-19.25 128.38,-19.25 128.38,0 181.88,0 181.88,-19.25"/>
|
||||
<text text-anchor="middle" x="155.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M126.74,-55.08C131.24,-48.03 137.71,-37.9 143.34,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.14,-31.2 148.57,-20.88 140.24,-27.43 146.14,-31.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="242.62,-19.25 199.62,-19.25 199.62,0 242.62,0 242.62,-19.25"/>
|
||||
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M138.09,-54.84C153.39,-46.69 176.16,-34.57 193.99,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="195.56,-28.2 202.74,-20.41 192.27,-22.02 195.56,-28.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
323
d2/d5a/subset__sum_8cpp.html
Normal file
@@ -0,0 +1,323 @@
|
||||
<!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.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: backtracking/subset_sum.cpp File Reference</title>
|
||||
<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="../../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/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<link href="../../doxygen.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="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<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('d2/d5a/subset__sum_8cpp.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="#namespaces">Namespaces</a> |
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle"><div class="title">subset_sum.cpp File Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Implementation of the <a href="https://en.wikipedia.org/wiki/Subset_sum_problem" target="_blank">Subset Sum</a> problem.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <cstdint></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for subset_sum.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/da8/subset__sum_8cpp__incl.svg" width="336" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dc0/namespacebacktracking.html">backtracking</a></td></tr>
|
||||
<tr class="memdesc:db/dc0/namespacebacktracking"><td class="mdescLeft"> </td><td class="mdescRight">for vector container <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d95/namespace_subsets.html">Subsets</a></td></tr>
|
||||
<tr class="memdesc:de/d95/namespace_subsets"><td class="mdescLeft"> </td><td class="mdescRight">Functions for the <a href="https://en.wikipedia.org/wiki/Subset_sum_problem" target="_blank">Subset Sum</a> problem. <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="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a7cb50d36a59427a33f64a266dac83d99" id="r_a7cb50d36a59427a33f64a266dac83d99"><td class="memItemLeft" align="right" valign="top">uint64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="#a7cb50d36a59427a33f64a266dac83d99">backtracking::subset_sum::number_of_subsets</a> (int32_t sum, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int32_t > &in_arr)</td></tr>
|
||||
<tr class="memdesc:a7cb50d36a59427a33f64a266dac83d99"><td class="mdescLeft"> </td><td class="mdescRight">The main function implements count of subsets. <br /></td></tr>
|
||||
<tr class="separator:a7cb50d36a59427a33f64a266dac83d99"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d" id="r_aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
|
||||
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft"> </td><td class="mdescRight">Test implementations. <br /></td></tr>
|
||||
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><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="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <br /></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Implementation of the <a href="https://en.wikipedia.org/wiki/Subset_sum_problem" target="_blank">Subset Sum</a> problem. </p>
|
||||
<p>We are given an array and a sum value. The algorithm finds all the subsets of that array with sum equal to the given sum and return such subsets count. This approach will have exponential time complexity. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Swastyy" target="_blank">Swastika Gupta</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int main </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">void</td> <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 104</span> {</div>
|
||||
<div class="line"><span class="lineno"> 105</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 107</span>}</div>
|
||||
<div class="ttc" id="asubset__sum_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Test implementations.</div><div class="ttdef"><b>Definition</b> subset_sum.cpp:58</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d5a/subset__sum_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="271" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a7cb50d36a59427a33f64a266dac83d99" name="a7cb50d36a59427a33f64a266dac83d99"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a7cb50d36a59427a33f64a266dac83d99">◆ </a></span>number_of_subsets()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">uint64_t backtracking::subset_sum::number_of_subsets </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int32_t</td> <td class="paramname"><span class="paramname"><em>sum</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int32_t > &</td> <td class="paramname"><span class="paramname"><em>in_arr</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The main function implements count of subsets. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">sum</td><td>is the required sum of any subset </td></tr>
|
||||
<tr><td class="paramname">in_arr</td><td>is the input array </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>count of the number of subsets with required sum </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 34</span> {</div>
|
||||
<div class="line"><span class="lineno"> 35</span> int32_t nelement = in_arr.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 36</span> uint64_t count_of_subset = 0;</div>
|
||||
<div class="line"><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordflow">for</span> (int32_t i = 0; i < (1 << (nelement)); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 39</span> int32_t <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a> = 0;</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">for</span> (int32_t j = 0; j < nelement; j++) {</div>
|
||||
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">if</span> (i & (1 << j)) {</div>
|
||||
<div class="line"><span class="lineno"> 42</span> <a class="code hl_function" href="../../d3/d84/word__break_8cpp.html#a272b0f5cdb4e41fd6dee4538b808c06a">check</a> += (in_arr[j]);</div>
|
||||
<div class="line"><span class="lineno"> 43</span> }</div>
|
||||
<div class="line"><span class="lineno"> 44</span> }</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <span class="keywordflow">if</span> (check == sum) {</div>
|
||||
<div class="line"><span class="lineno"> 46</span> count_of_subset++;</div>
|
||||
<div class="line"><span class="lineno"> 47</span> }</div>
|
||||
<div class="line"><span class="lineno"> 48</span> }</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> count_of_subset;</div>
|
||||
<div class="line"><span class="lineno"> 50</span>}</div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</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> word_break.cpp:80</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d5a/subset__sum_8cpp_a7cb50d36a59427a33f64a266dac83d99_cgraph.svg" width="350" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">static void test </td>
|
||||
<td>(</td>
|
||||
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 58</span> {</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"1st test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array1 = {-7, -3, -2, 5, 8}; <span class="comment">// input array</span></div>
|
||||
<div class="line"><span class="lineno"> 62</span> assert(backtracking::subset_sum::number_of_subsets(0, array1) ==</div>
|
||||
<div class="line"><span class="lineno"> 63</span> 2); <span class="comment">// first argument in subset_sum function is the required sum and</span></div>
|
||||
<div class="line"><span class="lineno"> 64</span> <span class="comment">// second is the input array</span></div>
|
||||
<div class="line"><span class="lineno"> 65</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="comment">// 2nd test</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"2nd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 69</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array2 = {1, 2, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 70</span> assert(backtracking::subset_sum::number_of_subsets(6, array2) ==</div>
|
||||
<div class="line"><span class="lineno"> 71</span> 3); <span class="comment">// here we are expecting 3 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> <span class="comment">// {(1,2,3),(1,2,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 73</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 74</span> </div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="comment">// 3rd test</span></div>
|
||||
<div class="line"><span class="lineno"> 76</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"3rd test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array3 = {1, 1, 1, 1};</div>
|
||||
<div class="line"><span class="lineno"> 78</span> assert(backtracking::subset_sum::number_of_subsets(1, array3) ==</div>
|
||||
<div class="line"><span class="lineno"> 79</span> 4); <span class="comment">// here we are expecting 4 subsets which sum up to 1 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 80</span> <span class="comment">// {(1),(1),(1),(1)}</span></div>
|
||||
<div class="line"><span class="lineno"> 81</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 82</span> </div>
|
||||
<div class="line"><span class="lineno"> 83</span> <span class="comment">// 4th test</span></div>
|
||||
<div class="line"><span class="lineno"> 84</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"4th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 85</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array4 = {3, 3, 3, 3};</div>
|
||||
<div class="line"><span class="lineno"> 86</span> assert(backtracking::subset_sum::number_of_subsets(6, array4) ==</div>
|
||||
<div class="line"><span class="lineno"> 87</span> 6); <span class="comment">// here we are expecting 6 subsets which sum up to 6 i.e.</span></div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="comment">// {(3,3),(3,3),(3,3),(3,3),(3,3),(3,3)}</span></div>
|
||||
<div class="line"><span class="lineno"> 89</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 90</span> </div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="comment">// Test 5</span></div>
|
||||
<div class="line"><span class="lineno"> 92</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"5th test "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 93</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int32_t></a> array5 = {};</div>
|
||||
<div class="line"><span class="lineno"> 94</span> assert(backtracking::subset_sum::number_of_subsets(6, array5) ==</div>
|
||||
<div class="line"><span class="lineno"> 95</span> 0); <span class="comment">// here we are expecting 0 subsets which sum up to 6 i.e. we</span></div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="comment">// cannot select anything from an empty array</span></div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"passed"</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 98</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d2/d5a/subset__sum_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="174" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_c11585dfcef32a26e29098facab6c144.html">backtracking</a></li><li class="navelem"><a class="el" href="../../d2/d5a/subset__sum_8cpp.html">subset_sum.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
6
d2/d5a/subset__sum_8cpp.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var subset__sum_8cpp =
|
||||
[
|
||||
[ "main", "d2/d5a/subset__sum_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "number_of_subsets", "d2/d5a/subset__sum_8cpp.html#a7cb50d36a59427a33f64a266dac83d99", null ],
|
||||
[ "test", "d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -0,0 +1,6 @@
|
||||
<map id="backtracking::subset_sum::number_of_subsets" name="backtracking::subset_sum::number_of_subsets">
|
||||
<area shape="rect" id="Node000001" title="The main function implements count of subsets." alt="" coords="5,29,181,70"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="56,29,54,19,60,10,73,5,93,3,114,5,127,11,124,16,113,10,93,8,75,10,64,15,60,20,61,28"/>
|
||||
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="229,37,344,62"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000002" title=" " alt="" coords="181,47,213,47,213,52,181,52"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
0167af918816be760ae4a84116edffca
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: backtracking::subset_sum::number_of_subsets Pages: 1 -->
|
||||
<svg width="262pt" height="57pt"
|
||||
viewBox="0.00 0.00 262.00 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
|
||||
<title>backtracking::subset_sum::number_of_subsets</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="The main function implements count of subsets.">
|
||||
<polygon fill="#999999" stroke="#666666" points="131.5,-30.5 0,-30.5 0,0 131.5,0 131.5,-30.5"/>
|
||||
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::subset</text>
|
||||
<text text-anchor="middle" x="65.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_sum::number_of_subsets</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1_Node000001_Node000001" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M40.06,-30.99C34.81,-40.06 43.38,-48.5 65.75,-48.5 77.99,-48.5 86.09,-45.97 90.07,-42.2"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="93.51,-42.84 91.26,-32.49 86.57,-41.99 93.51,-42.84"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="254,-24.88 167.5,-24.88 167.5,-5.63 254,-5.63 254,-24.88"/>
|
||||
<text text-anchor="middle" x="210.75" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge2_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M131.97,-15.25C139.9,-15.25 147.93,-15.25 155.66,-15.25"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="155.62,-18.75 165.62,-15.25 155.62,-11.75 155.62,-18.75"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,49 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: backtracking::subset_sum::number_of_subsets Pages: 1 -->
|
||||
<svg width="262pt" height="57pt"
|
||||
viewBox="0.00 0.00 262.00 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
|
||||
<title>backtracking::subset_sum::number_of_subsets</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="The main function implements count of subsets.">
|
||||
<polygon fill="#999999" stroke="#666666" points="131.5,-30.5 0,-30.5 0,0 131.5,0 131.5,-30.5"/>
|
||||
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">backtracking::subset</text>
|
||||
<text text-anchor="middle" x="65.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_sum::number_of_subsets</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1_Node000001_Node000001" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M40.06,-30.99C34.81,-40.06 43.38,-48.5 65.75,-48.5 77.99,-48.5 86.09,-45.97 90.07,-42.2"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="93.51,-42.84 91.26,-32.49 86.57,-41.99 93.51,-42.84"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="254,-24.88 167.5,-24.88 167.5,-5.63 254,-5.63 254,-24.88"/>
|
||||
<text text-anchor="middle" x="210.75" y="-11.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge2_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge2_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M131.97,-15.25C139.9,-15.25 147.93,-15.25 155.66,-15.25"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="155.62,-18.75 165.62,-15.25 155.62,-11.75 155.62,-18.75"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,5 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="Node000001" title="Test implementations." alt="" coords="5,5,49,31"/>
|
||||
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="97,5,168,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="49,16,81,16,81,21,49,21"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
bd038f66bf9d22bf1d56990307c4d8c4
|
||||
@@ -0,0 +1,65 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="130pt" height="27pt"
|
||||
viewBox="0.00 0.00 130.00 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>test</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Test implementations.">
|
||||
<polygon fill="#999999" stroke="#666666" points="32.5,-19.25 0,-19.25 0,0 32.5,0 32.5,-19.25"/>
|
||||
<text text-anchor="middle" x="16.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="122,-19.25 68.5,-19.25 68.5,0 122,0 122,-19.25"/>
|
||||
<text text-anchor="middle" x="95.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.83,-9.62C39.78,-9.62 48.3,-9.62 56.75,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="56.56,-13.13 66.56,-9.63 56.56,-6.13 56.56,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,39 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="130pt" height="27pt"
|
||||
viewBox="0.00 0.00 130.00 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>test</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Test implementations.">
|
||||
<polygon fill="#999999" stroke="#666666" points="32.5,-19.25 0,-19.25 0,0 32.5,0 32.5,-19.25"/>
|
||||
<text text-anchor="middle" x="16.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="122,-19.25 68.5,-19.25 68.5,0 122,0 122,-19.25"/>
|
||||
<text text-anchor="middle" x="95.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.83,-9.62C39.78,-9.62 48.3,-9.62 56.75,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="56.56,-13.13 66.56,-9.63 56.56,-6.13 56.56,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,7 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="Node000001" title="Main function." alt="" coords="5,5,55,31"/>
|
||||
<area shape="rect" id="Node000002" href="$d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Test implementations." alt="" coords="103,5,146,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,16,87,16,87,21,55,21"/>
|
||||
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="194,5,265,31"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="146,16,178,16,178,21,146,21"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
574f4d71b42b28252ea9230e978fabd8
|
||||
@@ -0,0 +1,83 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="203pt" height="27pt"
|
||||
viewBox="0.00 0.00 203.00 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="105.5,-19.25 73,-19.25 73,0 105.5,0 105.5,-19.25"/>
|
||||
<text text-anchor="middle" x="89.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.2,-9.62C44.58,-9.62 53.31,-9.62 61.45,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.2,-13.13 71.2,-9.63 61.2,-6.13 61.2,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="195,-19.25 141.5,-19.25 141.5,0 195,0 195,-19.25"/>
|
||||
<text text-anchor="middle" x="168.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.83,-9.62C112.78,-9.62 121.3,-9.62 129.75,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="129.56,-13.13 139.56,-9.63 129.56,-6.13 129.56,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,57 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="203pt" height="27pt"
|
||||
viewBox="0.00 0.00 203.00 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Main function.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-19.25 0,-19.25 0,0 37,0 37,-19.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../d2/d5a/subset__sum_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="105.5,-19.25 73,-19.25 73,0 105.5,0 105.5,-19.25"/>
|
||||
<text text-anchor="middle" x="89.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.2,-9.62C44.58,-9.62 53.31,-9.62 61.45,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.2,-13.13 71.2,-9.63 61.2,-6.13 61.2,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="195,-19.25 141.5,-19.25 141.5,0 195,0 195,-19.25"/>
|
||||
<text text-anchor="middle" x="168.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.83,-9.62C112.78,-9.62 121.3,-9.62 129.75,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="129.56,-13.13 139.56,-9.63 129.56,-6.13 129.56,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -256,7 +256,7 @@ int </td><td class="memItemRight" valign="bottom"><b>vertexNum</b> = 0</td>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this class was generated from the following file:<ul>
|
||||
<li>greedy_algorithms/<a class="el" href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html">dijkstra.cpp</a></li>
|
||||
<li>greedy_algorithms/<a class="el" href="../../da/de8/dijkstra__greedy_8cpp.html">dijkstra_greedy.cpp</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
|
||||
9
d2/dc5/armstrong__number__templated_8cpp__incl.map
Normal file
@@ -0,0 +1,9 @@
|
||||
<map id="dynamic_programming/armstrong_number_templated.cpp" name="dynamic_programming/armstrong_number_templated.cpp">
|
||||
<area shape="rect" id="Node000001" title="Checks whether a number is an Armstrong Number or not." alt="" coords="12,5,234,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,70,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="104,48,64,85,60,81,100,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="94,94,152,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="126,46,126,78,120,78,120,46"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="175,94,246,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="146,44,188,81,184,85,143,48"/>
|
||||
</map>
|
||||
1
d2/dc5/armstrong__number__templated_8cpp__incl.md5
Normal file
@@ -0,0 +1 @@
|
||||
f9f350893c63652ce6bbc333e7e71e77
|
||||
@@ -3,9 +3,9 @@
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms/dijkstra.cpp Pages: 1 -->
|
||||
<svg width="251pt" height="83pt"
|
||||
viewBox="0.00 0.00 250.62 82.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Title: dynamic_programming/armstrong_number_templated.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="94pt"
|
||||
viewBox="0.00 0.00 188.88 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
@@ -17,14 +17,15 @@
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 78.5)">
|
||||
<title>greedy_algorithms/dijkstra.cpp</title>
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 89.75)">
|
||||
<title>dynamic_programming/armstrong_number_templated.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Dijkstra algorithm implementation">
|
||||
<polygon fill="#999999" stroke="#666666" points="195.5,-74.5 46.75,-74.5 46.75,-55.25 195.5,-55.25 195.5,-74.5"/>
|
||||
<text text-anchor="middle" x="121.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms/dijkstra.cpp</text>
|
||||
<g id="a_Node000001"><a xlink:title="Checks whether a number is an Armstrong Number or not.">
|
||||
<polygon fill="#999999" stroke="#666666" points="171.5,-85.75 4.75,-85.75 4.75,-55.25 171.5,-55.25 171.5,-85.75"/>
|
||||
<text text-anchor="start" x="12.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="88.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/armstrong_number_templated.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -41,8 +42,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M104.67,-54.84C89.9,-46.73 67.95,-34.68 50.69,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="52.44,-22.18 41.99,-20.43 49.07,-28.31 52.44,-22.18"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M72.3,-54.95C63.22,-46.59 51.76,-36.05 42.31,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="44.83,-24.92 35.11,-20.73 40.1,-30.07 44.83,-24.92"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -50,8 +51,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="110.38,-19.25 65.88,-19.25 65.88,0 110.38,0 110.38,-19.25"/>
|
||||
<text text-anchor="middle" x="88.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">climits</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="109.62,-19.25 66.62,-19.25 66.62,0 109.62,0 109.62,-19.25"/>
|
||||
<text text-anchor="middle" x="88.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cmath</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -59,8 +60,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M115.68,-55.08C111.35,-48.11 105.16,-38.12 99.74,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="102.73,-27.55 94.49,-20.9 96.78,-31.24 102.73,-27.55"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M88.12,-54.95C88.12,-47.71 88.12,-38.84 88.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.63,-31.21 88.13,-21.21 84.63,-31.21 91.63,-31.21"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -68,8 +69,8 @@
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="181.88,-19.25 128.38,-19.25 128.38,0 181.88,0 181.88,-19.25"/>
|
||||
<text text-anchor="middle" x="155.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="180.88,-19.25 127.38,-19.25 127.38,0 180.88,0 180.88,-19.25"/>
|
||||
<text text-anchor="middle" x="154.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -77,26 +78,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M126.74,-55.08C131.24,-48.03 137.71,-37.9 143.34,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="146.14,-31.2 148.57,-20.88 140.24,-27.43 146.14,-31.2"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="242.62,-19.25 199.62,-19.25 199.62,0 242.62,0 242.62,-19.25"/>
|
||||
<text text-anchor="middle" x="221.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M138.09,-54.84C153.39,-46.69 176.16,-34.57 193.99,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="195.56,-28.2 202.74,-20.41 192.27,-22.02 195.56,-28.2"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M104.44,-54.95C113.81,-46.59 125.62,-36.05 135.38,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="137.69,-29.98 142.82,-20.71 133.03,-24.75 137.69,-29.98"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.0 KiB |
76
d2/dc5/armstrong__number__templated_8cpp__incl_org.svg
Normal file
@@ -0,0 +1,76 @@
|
||||
<?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.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: dynamic_programming/armstrong_number_templated.cpp Pages: 1 -->
|
||||
<svg width="189pt" height="94pt"
|
||||
viewBox="0.00 0.00 188.88 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 89.75)">
|
||||
<title>dynamic_programming/armstrong_number_templated.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Checks whether a number is an Armstrong Number or not.">
|
||||
<polygon fill="#999999" stroke="#666666" points="171.5,-85.75 4.75,-85.75 4.75,-55.25 171.5,-55.25 171.5,-85.75"/>
|
||||
<text text-anchor="start" x="12.75" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">dynamic_programming</text>
|
||||
<text text-anchor="middle" x="88.12" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">/armstrong_number_templated.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="48.25,-19.25 0,-19.25 0,0 48.25,0 48.25,-19.25"/>
|
||||
<text text-anchor="middle" x="24.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M72.3,-54.95C63.22,-46.59 51.76,-36.05 42.31,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="44.83,-24.92 35.11,-20.73 40.1,-30.07 44.83,-24.92"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="109.62,-19.25 66.62,-19.25 66.62,0 109.62,0 109.62,-19.25"/>
|
||||
<text text-anchor="middle" x="88.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cmath</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M88.12,-54.95C88.12,-47.71 88.12,-38.84 88.12,-30.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="91.63,-31.21 88.13,-21.21 84.63,-31.21 91.63,-31.21"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="180.88,-19.25 127.38,-19.25 127.38,0 180.88,0 180.88,-19.25"/>
|
||||
<text text-anchor="middle" x="154.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M104.44,-54.95C113.81,-46.59 125.62,-36.05 135.38,-27.35"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="137.69,-29.98 142.82,-20.71 133.03,-24.75 137.69,-29.98"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |