Documentation for f7a5aecce5

This commit is contained in:
github-actions
2021-09-27 00:09:08 +00:00
parent 8808b968ea
commit c61d35bf51
338 changed files with 3221 additions and 1754 deletions

View File

@@ -135,7 +135,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" target="_blank">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_md58"></a>
<h3><a class="anchor" id="autotoc_md59"></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" target="_blank">Anmol</a> </dd>

View File

@@ -0,0 +1,7 @@
<map id="data_structures/reverse_a_linked_list.cpp" name="data_structures/reverse_a_linked_list.cpp">
<area shape="rect" id="node1" title="Implementation of Reversing a single linked list" alt="" coords="98,5,261,47"/>
<area shape="rect" id="node2" title=" " alt="" coords="5,95,71,121"/>
<area shape="rect" id="node3" title=" " alt="" coords="95,95,168,121"/>
<area shape="rect" id="node4" title=" " alt="" coords="192,95,263,121"/>
<area shape="rect" id="node5" title=" " alt="" coords="287,95,333,121"/>
</map>

View File

@@ -0,0 +1 @@
0dfa9e86898d94413bac8a7a3cecff89

View File

@@ -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 2.49.0 (20210828.1703)
-->
<!-- Title: data_structures/reverse_a_linked_list.cpp Pages: 1 -->
<svg width="254pt" height="95pt"
viewBox="0.00 0.00 254.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)">
<title>data_structures/reverse_a_linked_list.cpp</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-91 250,-91 250,4 -4,4"/>
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="Implementation of Reversing a single linked list">
<polygon fill="#bfbfbf" stroke="black" points="69.5,-56.5 69.5,-86.5 191.5,-86.5 191.5,-56.5 69.5,-56.5"/>
<text text-anchor="start" x="77.5" y="-74.5" font-family="Helvetica,sans-Serif" font-size="10.00">data_structures/reverse</text>
<text text-anchor="middle" x="130.5" y="-63.5" font-family="Helvetica,sans-Serif" font-size="10.00">_a_linked_list.cpp</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:title=" ">
<polygon fill="white" stroke="#bfbfbf" points="0,-0.5 0,-19.5 49,-19.5 49,-0.5 0,-0.5"/>
<text text-anchor="middle" x="24.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1" class="edge">
<title>Node1&#45;&gt;Node2</title>
<path fill="none" stroke="midnightblue" d="M105.38,-56.4C88.23,-46.77 65.64,-34.09 48.69,-24.58"/>
<polygon fill="midnightblue" stroke="midnightblue" points="50.36,-21.5 39.92,-19.66 46.93,-27.6 50.36,-21.5"/>
</g>
<!-- Node3 -->
<g id="node3" class="node">
<title>Node3</title>
<g id="a_node3"><a xlink:title=" ">
<polygon fill="white" stroke="#bfbfbf" points="67,-0.5 67,-19.5 122,-19.5 122,-0.5 67,-0.5"/>
<text text-anchor="middle" x="94.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2" class="edge">
<title>Node1&#45;&gt;Node3</title>
<path fill="none" stroke="midnightblue" d="M121.97,-56.4C116.9,-48.02 110.43,-37.33 105.04,-28.42"/>
<polygon fill="midnightblue" stroke="midnightblue" points="107.91,-26.4 99.74,-19.66 101.92,-30.03 107.91,-26.4"/>
</g>
<!-- Node4 -->
<g id="node4" class="node">
<title>Node4</title>
<g id="a_node4"><a xlink:title=" ">
<polygon fill="white" stroke="#bfbfbf" points="140,-0.5 140,-19.5 193,-19.5 193,-0.5 140,-0.5"/>
<text text-anchor="middle" x="166.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">memory</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node4 -->
<g id="edge3" class="edge">
<title>Node1&#45;&gt;Node4</title>
<path fill="none" stroke="midnightblue" d="M139.03,-56.4C144.1,-48.02 150.57,-37.33 155.96,-28.42"/>
<polygon fill="midnightblue" stroke="midnightblue" points="159.08,-30.03 161.26,-19.66 153.09,-26.4 159.08,-30.03"/>
</g>
<!-- Node5 -->
<g id="node5" class="node">
<title>Node5</title>
<g id="a_node5"><a xlink:title=" ">
<polygon fill="white" stroke="#bfbfbf" points="211,-0.5 211,-19.5 246,-19.5 246,-0.5 211,-0.5"/>
<text text-anchor="middle" x="228.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">new</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node5 -->
<g id="edge4" class="edge">
<title>Node1&#45;&gt;Node5</title>
<path fill="none" stroke="midnightblue" d="M153.72,-56.4C169.29,-46.95 189.7,-34.56 205.26,-25.11"/>
<polygon fill="midnightblue" stroke="midnightblue" points="207.51,-27.84 214.24,-19.66 203.88,-21.86 207.51,-27.84"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -131,7 +131,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" target="_blank">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_md63"></a>
<h3><a class="anchor" id="autotoc_md64"></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" target="_blank">Ayush Singh</a> </dd></dl>