Maximum Circular Subarray Sum

i cant understand this concept of max circular subarray
plz guide me
or provide some link to refer

hi Ashi are u not getting the question or logic?

i know what logic we need to apply but i dont know y we r applying that

basically whats difference between a circular and a non circular sub array

i would be really helpful if u could suggest some ref. video lecture or some link for me to refer .

Ok I will have u an example
Suppose
1 2 3 4 5
Sub array can be
1
1 2
1 2 3
But not 4 5 1
In circular array u have both the side end side as well from end side u can restart by taking element like 3 4 5 1 this can be a cyclic sub array
Hope this help
For videos gave me some time I will suggest u the best one

oki thanks still if u get some video link to refer then plz share

@ashigupta.gupta570 let’s assume all the elements are arranged in a circle, if we remove the most negative part from the circle what remains will be the maximum positive part of the circle.
We don’t have a method for finding the most negative part, but we do have a method for finding the most positive part.
So, we inverse the array by multiplying every element of if with -1, and then we find the maximum positive sum. The maximum sum of this inverted array will be the most negative part of the original array.
Let’s say that the maximum positive sum for the inverted array comes out to be ‘n’, hence we know that ‘-n’ is the most negative value of the original array.
Also, lets store the sum of all the elements of the original array in a variable SUM. Now we have to remove ‘-n’ from the variable SUM, i.e. SUM - (-n) which in turn is equal to SUM + n . This case only covers the overlapping cases.
We take another sum candidate of the linear array and apply kadane’s algorithm to it to find the max sum of the linear array.
Then we return the maximum of those two candidates.

Hope this helps.

thanks
!!!

hey can u plz tell how can i access the live webinars !!!

You can watch the webinars given in the course for now. And regarding the live webinars, notifications will be rolled out of the time and date of webinars.
Also, mark the doubt as resolved if your problem has been solved.
Thank you.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.