In this problem, there can be two cases i.e either the subarray having maximum sum is obtained in a circular fashion or the subarray having maximum sum is obtained in a non-circular fashion.
The non-circular maximum sum subarray ca be obtained directly by KADANE’S ALGORITHM. But the subarray with circular fashion cannot be solved by kadane’s algorithm.
Step 1 : Calculate the maximum sum subar
No comment yet.
Your email address will not be published. Required fields are marked *
Your Name (required)
Your Email (required)