Documentation for e813f9b2a6

This commit is contained in:
github-actions
2021-02-05 10:11:27 +00:00
parent e044750129
commit 3d06b0aa77
406 changed files with 7862 additions and 6611 deletions

View File

@@ -136,7 +136,7 @@ Functions</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of <a href="https://en.wikipedia.org/wiki/Knapsack_problem">0-1 Knapsack Problem</a> </p>
<p>Given weights and values of n items, put these items in a knapsack of capacity <code>W</code> to get the maximum total value in the knapsack. In other words, given two integer arrays <code>val[0..n-1]</code> and <code>wt[0..n-1]</code> which represent values and weights associated with n items respectively. Also given an integer W which represents knapsack capacity, find out the maximum value subset of <code>val[]</code> such that sum of the weights of this subset is smaller than or equal to W. You cannot break an item, either pick the complete item or dont pick it (0-1 property)</p>
<h3><a class="anchor" id="autotoc_md50"></a>
<h3><a class="anchor" id="autotoc_md51"></a>
Algorithm</h3>
<p>The idea is to consider all subsets of items and calculate the total weight and value of all subsets. Consider the only subsets whose total weight is smaller than <code>W</code>. From all such subsets, pick the maximum value subset.</p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Anmol3299">Anmol</a> </dd>

View File

@@ -132,7 +132,7 @@ Functions</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of <a href="https://en.wikipedia.org/wiki/Kadane%27s_algorithm">Kadane Algorithm</a> </p>
<p>Kadane algorithm is used to find the maximum sum subarray in an array and maximum sum subarray problem is the task of finding a contiguous subarray with the largest sum</p>
<h3><a class="anchor" id="autotoc_md54"></a>
<h3><a class="anchor" id="autotoc_md55"></a>
Algorithm</h3>
<p>The simple idea of the algorithm is to search for all positive contiguous segments of the array and keep track of maximum sum contiguous segment among all positive segments(curr_sum is used for this) Each time we get a positive sum we compare it with max_sum and update max_sum if it is greater than curr_sum</p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/ayush523">Ayush Singh</a> </dd></dl>

View File

@@ -1,4 +1,3 @@
<map id="list" name="list">
<area shape="rect" id="node1" title=" " alt="" coords="55,95,93,121"/>
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/array.html" title=" " alt="" coords="5,5,143,32"/>
<area shape="rect" id="node1" title=" " alt="" coords="5,5,44,32"/>
</map>

View File

@@ -1 +1 @@
6ffed9121e4ea2f09f675ee144e31b81
b27f82817fdb09c9c12cc0ea928971fc

View File

@@ -4,42 +4,26 @@
<!-- Generated by graphviz version 2.46.0 (20210118.1747)
-->
<!-- Title: list Pages: 1 -->
<svg width="114pt" height="95pt"
viewBox="0.00 0.00 114.00 95.00" 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 91)">
<svg width="77pt" height="28pt"
viewBox="0.00 0.00 77.00 28.00" 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 24)">
<title>list</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-91 110,-91 110,4 -4,4"/>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-24 73,-24 73,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title=" ">
<polygon fill="#bfbfbf" stroke="black" points="37,-0.5 37,-19.5 66,-19.5 66,-0.5 37,-0.5"/>
<text text-anchor="middle" x="51.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">list</text>
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-19.5 29,-19.5 29,-0.5 0,-0.5"/>
<text text-anchor="middle" x="14.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">list</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M76.55,-15.63C80.94,-14.88 84,-13.01 84,-10 84,-4.94 75.32,-3.08 66.21,-4.42"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="76.22,-12.13 66.21,-15.58 76.19,-19.13 76.22,-12.13"/>
<text text-anchor="middle" x="95" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00"> next</text>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/array.html" xlink:title=" ">
<polygon fill="white" stroke="black" points="0,-67.5 0,-86.5 103,-86.5 103,-67.5 0,-67.5"/>
<text text-anchor="middle" x="51.5" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::array&lt; int, 50 &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node1 -->
<g id="edge1" class="edge">
<title>Node2&#45;&gt;Node1</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M51.5,-57.04C51.5,-44.67 51.5,-29.12 51.5,-19.63"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="48,-57.23 51.5,-67.23 55,-57.23 48,-57.23"/>
<text text-anchor="middle" x="62.5" y="-41" font-family="Helvetica,sans-Serif" font-size="10.00"> data</text>
<title>Node1&#45;&gt;Node1</title>
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M39.55,-13.52C43.94,-13.05 47,-11.88 47,-10 47,-6.84 38.32,-5.67 29.21,-6.51"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="39.22,-10.02 29.21,-13.49 39.2,-17.02 39.22,-10.02"/>
<text text-anchor="middle" x="58" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00"> next</text>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB