mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-12 11:37:18 +08:00
Documentation for 582cdc7cc4
This commit is contained in:
@@ -138,7 +138,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_md71"></a>
|
||||
<h3><a class="anchor" id="autotoc_md72"></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>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<map id="dynamic_programming::kadane::maxSubArray" name="dynamic_programming::kadane::maxSubArray">
|
||||
<area shape="rect" id="node1" title="maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum s..." coords="5,29,164,69"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " coords="212,37,285,62"/>
|
||||
<area shape="rect" id="node1" title="maxSubArray function is used to calculate the maximum sum subarray and returns the value of maximum s..." alt="" coords="5,29,164,69"/>
|
||||
<area shape="rect" id="node2" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/max.html#" title=" " alt="" coords="212,37,285,62"/>
|
||||
</map>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 7.0.2 (20221119.0110)
|
||||
<!-- Generated by graphviz version 7.0.4 (20221203.1631)
|
||||
-->
|
||||
<!-- Title: dynamic_programming::kadane::maxSubArray Pages: 1 -->
|
||||
<svg width="218pt" height="56pt"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Reference in New Issue
Block a user