Maximum Sum Rectangular Submatrix in Matrix dynamic programming/2D kadane

preview_player
Показать описание
Find maximum sum rectangle in 2D matrix.
Рекомендации по теме
Комментарии
Автор

2, 0, 2, -3 maximum sum using Kadence algorithm is 4

khaleja
Автор

if you are watching this in lockdown you are one of the rare species on the earth . many students are wasting their time on facebook, youtube, twitter, netflix, watching movies playing pubg, but you are working hard to achieve something . ALL the best ...nitj student here

Official-tknc
Автор

Nice initiative dude. I'd advice you to give a proof of concept of the algorithm you are walking through, like why this would actually always work. For some algorithms its trivial but for some it's not. Its always good for the sake of completeness. Like in this example, for every column_start and column_end combination you are finding the maximum submatrix and then taking the max of all those combinations. Anyways, a really good initiative and keep up the good work.

youngmoney
Автор

Beautiful! I was looking for a simple explanation, and this is by far the best i've found. Great work!

ranavij
Автор

Very well done video. Thank you for tracing steps and explaining logic without code. That's really important

Cryogenics
Автор

omg it's 2019 and you are still contributing to the coding noobs like me! Love you~~

clusteringmiu
Автор

Coming back to this even after 6 years of college. Big Time Nostalgia !!!

nitin
Автор

When, L = 0 and R = 0. isn't the max sum 4? Why is it 5?

saifurrahmanbhuiyan
Автор

perfectly explained, thanks a lot for this tutorial 👍👍👍👍🙂🙂🙂🙂

SmartProgramming
Автор

Became Fan boy of Tushar Roy.. Great Explanation.

rajendrab
Автор

Beautifully explained. Please upload more videos... Will recommend this channel to all my friends...

harishkumarrayasam
Автор

Thanks tushar...you are doing a wonderful job and helping the coding community a lot...big follower of your videos

RaviKumar-vkib
Автор

awesome explanation, but i think there is a bug in your implmentation
{code}
for(int i=0; i < arr.length; i++){
maxSoFar += arr[i];
if(maxSoFar < 0){
maxSoFar = 0;
currentStart = i+1;
}
if(max < maxSoFar){
maxStart = currentStart;
maxEnd = i;
max = maxSoFar;
}
}
{code}

you should check if(max < maxSoFar) before if(maxSoFar < 0), just image if the whole array is negative. you will end up with 0 as the max sum which is incorrect

xxmajia
Автор

What an explanation
It was so clear that I wrote code on my own

mayur_madhwani
Автор

This is a good initiative. But I find your videos focused on going through the procedure rather than explaining how one should approach the problem.

akshayjagtap
Автор

thanks! I was shocked at the first time for the current sum=5 instead 4, but the best explanation I found! :)

nicolaswolyniec
Автор

Very good explanation, very clear. Thank you very much 👍🏻

Felix-woqz
Автор

This is such a lovely and lucid explanation.

darshitdalal
Автор

explanation was very clear and I understood the solution in one go. Thanks.

rizz_z
Автор

Yeah you explained it very well but a little intuitive walk through for the algorithm will be great!

abhimanyushekhawat