|  | TheAlgorithms/C++ 1.0.0
    All the algorithms implemented in C++ | 
C++ program for maximum contiguous circular sum problem using Kadane's Algorithm More...
#include <cassert>#include <iostream>#include <vector>Go to the source code of this file.
| Namespaces | |
| namespace | dynamic_programming | 
| Dynamic Programming algorithms. | |
| Functions | |
| int | dynamic_programming::maxCircularSum (std::vector< int > &arr) | 
| returns the maximum contiguous circular sum of an array | |
| static void | test () | 
| Self-test implementation. | |
| int | main () | 
| Main function. | |
C++ program for maximum contiguous circular sum problem using Kadane's Algorithm
The idea is to modify Kadane’s algorithm to find a minimum contiguous subarray sum and the maximum contiguous subarray sum, then check for the maximum value between the max_value and the value left after subtracting min_value from the total sum. For more information, check Geeks For Geeks explanation page.
Definition in file maximum_circular_subarray.cpp.
| int main | ( | void | ) | 
Main function.
Definition at line 84 of file maximum_circular_subarray.cpp.
| 
 | static | 
Self-test implementation.
Definition at line 64 of file maximum_circular_subarray.cpp.