Documentation for 0931d530ae

This commit is contained in:
github-actions
2023-01-22 19:44:10 +00:00
parent a448f64699
commit b48f6e8671
2457 changed files with 9513 additions and 8691 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: range_queries/segtree.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -119,24 +119,24 @@ Include dependency graph for segtree.cpp:</div>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae752659b7c1719d68fdb2ca538a93696"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">ConsTree</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int64_t &gt; &amp;arr, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int64_t &gt; *segtree, uint64_t low, uint64_t high, uint64_t pos)</td></tr>
<tr class="memdesc:ae752659b7c1719d68fdb2ca538a93696"><td class="mdescLeft">&#160;</td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> <a href="../../d2/d45/segtree_8cpp.html#ae752659b7c1719d68fdb2ca538a93696">More...</a><br /></td></tr>
<tr class="memdesc:ae752659b7c1719d68fdb2ca538a93696"><td class="mdescLeft">&#160;</td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> <br /></td></tr>
<tr class="separator:ae752659b7c1719d68fdb2ca538a93696"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a423a97ea0c7ea6e33b5844a6858d902d"><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">query</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int64_t &gt; *segtree, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int64_t &gt; *lazy, uint64_t qlow, uint64_t qhigh, uint64_t low, uint64_t high, uint64_t pos)</td></tr>
<tr class="memdesc:a423a97ea0c7ea6e33b5844a6858d902d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the sum of all elements in a range. <a href="../../d2/d45/segtree_8cpp.html#a423a97ea0c7ea6e33b5844a6858d902d">More...</a><br /></td></tr>
<tr class="memdesc:a423a97ea0c7ea6e33b5844a6858d902d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the sum of all elements in a range. <br /></td></tr>
<tr class="separator:a423a97ea0c7ea6e33b5844a6858d902d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd3e818681fb2e29cf08f4f60f82c8e0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">update</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int64_t &gt; *segtree, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int64_t &gt; *lazy, int64_t start, int64_t end, int64_t delta, uint64_t low, uint64_t high, uint64_t pos)</td></tr>
<tr class="memdesc:abd3e818681fb2e29cf08f4f60f82c8e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates a range of the segment tree. <a href="../../d2/d45/segtree_8cpp.html#abd3e818681fb2e29cf08f4f60f82c8e0">More...</a><br /></td></tr>
<tr class="memdesc:abd3e818681fb2e29cf08f4f60f82c8e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates a range of the segment tree. <br /></td></tr>
<tr class="separator:abd3e818681fb2e29cf08f4f60f82c8e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d45/segtree_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementation. <a href="../../d2/d45/segtree_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">More...</a><br /></td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementation. <br /></td></tr>
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d45/segtree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <a href="../../d2/d45/segtree_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Implementation of [Segment Tree] (<a href="https://en.wikipedia.org/wiki/Segment_tree">https://en.wikipedia.org/wiki/Segment_tree</a>) data structure. </p>
<p >A segment tree, also known as a statistic tree, is a tree data structure used for storing information about intervals, or segments. Its classical version allows querying which of the stored segments contain a given point, but our modification allows us to perform (query) any binary operation on any range in the array in O(logN) time. Here, we have used addition (+). For range updates, we have used lazy propagation.</p>
<div class="textblock"><p>Implementation of [Segment Tree] (<a href="https://en.wikipedia.org/wiki/Segment_tree">https://en.wikipedia.org/wiki/Segment_tree</a>) data structure. </p>
<p>A segment tree, also known as a statistic tree, is a tree data structure used for storing information about intervals, or segments. Its classical version allows querying which of the stored segments contain a given point, but our modification allows us to perform (query) any binary operation on any range in the array in O(logN) time. Here, we have used addition (+). For range updates, we have used lazy propagation.</p>
<ul>
<li>Space Complexity : O(NlogN) <br />
</li>
@@ -194,8 +194,8 @@ 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 >Constructs the initial segment tree</p>
<p>for assert for log2 for IO operations</p>
<p>Constructs the initial segment tree</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">arr</td><td>input to construct the tree out of </td></tr>
@@ -590,7 +590,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_074119ce3a874b57120c49a0cc4bb5ad.html">range_queries</a></li><li class="navelem"><a class="el" href="../../d2/d45/segtree_8cpp.html">segtree.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.9.5 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
</ul>
</div>
</body>