You are a life saver! Even coursera course on dsa didn't explain as beautifully as you did. Reading out of a slide made it hard to understand. Your teaching method works like a charm! I'm honoured that you do these videos balancing your work life. Thank you surya!
wtf i seriously don't understand why you have only 38K subs. I've been working on Algorithm on my own for the last 6 months and have seen more than 100 channels. They're all great but I have never seen a channel better than yours. I will spread this out to help more people. Thanks always bro.
Ad will cost good amount of money which I don't have right now 😅 So, I am relying on word of mouth to spread the existence of this channel. Thanks for helping.
@@techdose4u Your sub# is too low for this quality. I am thankful for this channel so much! I will try to go over as much as possible before the interview. Always cheers!
This is by far the BEST explanation compared to all coding platform giants. Your videos on DSA are superb and to the point. Much much appreciation and love !! You are great !!!!
I was very furious about English explaination but when I started watching him , his explanation is enough to understand you what actually a code wants from you as well as very clear explanation
Bro I scroll upto 10 times down videos on TH-cam for dp there are so many great I watched all of them one by one but you're hero among all of them.... keep going you'll be remarkable one day
This was a great explaination! Helped me a lot with my coding homework in university, which I could not solve. (Currently studying computer science in Germany.) Keep the great work going! :)
if N = (length of W)-1, then your base condition should be like this if (N==-1 || W==0) return 0 if N = (length of W), then your other condition should be like this if(wt[n-1]>w)......
It will come in graph playlist. I will cover those topics later. There are some topics left in graph. But everyone was requesting for DP to start ASAP, so I left graph for now. I will resume it only after finishing easier topics.
This is the best explanation for recursion I,ve heard till now ,Your way of explanation is very nice and helpful for me to understand each and every step in detail.
This is a small token of thanks for the knowledge I have received from watching your videos. I have started studying DS and Algos all over again after a decade to prep for interviews. I used to get bored and demotivated after a while and the LC solutions can sometimes be tricky to understand almost to the point of giving up, but your explanations, diagrams and points are so easy to understand and remember. They are also addictive to watch, lol. The fact that you can keep your students engaged and interested in the content truly makes you an amazing teacher! I hope more people benefit and contribute to your channel :) Thank you so much for your hard work and effort!
Sir your explanation is awesome...It will be best if you can provide the questions links of the problems of the theory covered, from which we can practice :)
Why do we start from last element of array (N-1)? Naturally I will start from 0th element of array till N-1. Are there any benefits or challenges in thinking reverse?
Your video is very clear thankyou for making it. However i am trying to adapt it in order to save the optimal configuration the recursion find. With your code I only have the maximum profit but the configuration is transparent. I thought abour builind a binary tree but i am struggling with it. Would someone has an idea?
@@techdose4u I want to keep the optimal decision tree. I understand that with your algorithm I have the maximum possible profit but i don't know wich configuration leeds to this maximum profit. I don't know if the binary tree is the good solution but it is just the intuition I've had. Each decison ( 'take it' or 'not take it') would create a new branch. When the algo is over, I would just have to parse the good configuration from the tree.
14:06 if we skip the item, the profit will obviously be lesser of the included right? Or... Skipped item will recur to its previous items and return the profit?
sir I am not form cs background , so how much time it will take to cover cs subjects for placement preparation. I have watched your video in which you said to complete them in 2 days per subject. Will 2 days be sufficient for a placement in big companies. Please reply.....
Hey, Are you planning/giving any private tuition ( one-one online or in-person ( especially focusing on the effective c++ by Scott Meyers approach ) on C++? If it is so, is it possible to send you a private message to discuss further?
If weight of current element is greater than the available space, then skip it. If no of elements becomes 0 or the knapsack becomes full, then return; Else we can either include current element and go to furthur processing or we can skip this current element and go to next element for processing because this element may give us lower profit compared to other elements
You are a life saver! Even coursera course on dsa didn't explain as beautifully as you did. Reading out of a slide made it hard to understand. Your teaching method works like a charm! I'm honoured that you do these videos balancing your work life. Thank you surya!
Welcome
wtf i seriously don't understand why you have only 38K subs. I've been working on Algorithm on my own for the last 6 months and have seen more than 100 channels. They're all great but I have never seen a channel better than yours. I will spread this out to help more people. Thanks always bro.
maybe you should do more ad or some commercials this channel is extremely underrated
Thanks for your support bro :)
Ad will cost good amount of money which I don't have right now 😅 So, I am relying on word of mouth to spread the existence of this channel. Thanks for helping.
@@techdose4u Your sub# is too low for this quality. I am thankful for this channel so much! I will try to go over as much as possible before the interview. Always cheers!
Completely agreed
This explanation is the best I have ever found for recursion! Covering each and every small detail, step by step 👌
Nice :)
Kabhi aditya verma ka naam suna h?
@@sanskarrawat1047 na sunnA HOGA PAKKA YE
This is by far the BEST explanation compared to all coding platform giants. Your videos on DSA are superb and to the point. Much much appreciation and love !! You are great !!!!
I was very furious about English explaination but when I started watching him , his explanation is enough to understand you what actually a code wants from you as well as very clear explanation
Thanks ☺️
Man my God keep you in great happiness.. YOU ARE MY LEGEND
I think you should do more dp problems with their recursive solution first...it really helps in building the thought process of the problem...
Yea sure
@@techdose4u yes sir ur way to approach the problem is very nice it helps to build intuition , please continue building this playlist!
thank you; you're a godsend. you have helped me understand so many concepts that i previously couldn't grasp.
best explanation till now of knapsack
Bro I scroll upto 10 times down videos on TH-cam for dp there are so many great I watched all of them one by one but you're hero among all of them.... keep going you'll be remarkable one day
You make us falling love in coding !! Thank you very much for your effort !!!
Welcome :)
thank you so much for this much detailed and pin poined thing ....it was really really helpful and the best till now... .
This explanation is absolutely superb. This at the next one about memoization really helped. Recommending it on my uni algorithm course. Cheers!
The naive approach was explained intuitively. Thank you!
Welcome ;)
This was a great explaination! Helped me a lot with my coding homework in university, which I could not solve. (Currently studying computer science in Germany.) Keep the great work going!
:)
Thanks for your appreciation :)
I am following this channel when it has 10k..finally got what u deserve..congrats for 100k subs
Thanks 🙏🏼
this is a great channel, even better than I was thought.
Best explanation ever. I am subscribing this very minute
👍
Brilliant Teacher ❤️❤️
These videos are amazing.buddy. Just amazing...i finally understamd
Great ❤️
Thank u for this tutorial, great explanation.
Really appreciate it
This is explained really well. Thanks Tech Dose. I love your channel.
Welcome :)
Thanks for the great videos man, I am learning DP from your playlist only, and I haven't done DP ever before.
Great bro :)
Very helpful 👍
I am waiting for combination sum with all its variations. Please introduce it. Thanks for the good work.
I will upload it someday :)
Simply awesome explanation
Thanks :)
You explain so well .. Thnk you so much
Welcome
Excellent 👌
best lecture bro great explanation
Thanks :)
Thank you for this video💙
This is so helpful 🥺
his explanatation is much more similar to Aditya varma explanation for same question.
Both are super
sir, you explained it beautifully .
Thanks
Great explanation .
if N = (length of W)-1, then your base condition should be like this
if (N==-1 || W==0) return 0
if N = (length of W), then your other condition should be like this
if(wt[n-1]>w)......
waiting for video on Travelling salesman problem. Be it in graph theory or DP playlist.
It will come in graph playlist. I will cover those topics later. There are some topics left in graph. But everyone was requesting for DP to start ASAP, so I left graph for now. I will resume it only after finishing easier topics.
Great explanation. I want to know whats the advantage of traversing array from back (n-1 to 0). I have seen it many times in other codes.
It is to satisfy the generic principle of Recursion that goes from N to base case. Here, the base case is N=0 that is no item to process.
Clear cut explaination,Favourite teacher ever.Keep Rocking sir.Thank u sir🔥😍🔥
Welcome :)
Best explanation!!
Thanks
This is the best explanation for recursion I,ve heard till now ,Your way of explanation is very nice and helpful for me to understand each and every step in detail.
Thanks 😊
Thanks
This is a small token of thanks for the knowledge I have received from watching your videos. I have started studying DS and Algos all over again after a decade to prep for interviews. I used to get bored and demotivated after a while and the LC solutions can sometimes be tricky to understand almost to the point of giving up, but your explanations, diagrams and points are so easy to understand and remember. They are also addictive to watch, lol. The fact that you can keep your students engaged and interested in the content truly makes you an amazing teacher! I hope more people benefit and contribute to your channel :) Thank you so much for your hard work and effort!
great explanation 👍🏻
Excellent, Thank you!!!! :)
Welcome
Sir your explanation is awesome...It will be best if you can provide the questions links of the problems of the theory covered, from which we can practice :)
👍🏼
The base condition should be if(n
you are right bro👍👍
@@kr_ankit123 but later on , I understood that he is explaining from 1 based indexing.
Great video, thank you! How could I also output the volume along with the value of the knapsack?
Very nice
Thanks
This was amazing.
Thanks :)
Thanks, Algo Buddy. By the way, this one is much like backtracking.
True :)
thank u sir for making this dp series
is this dp series is enough to clear our all dp concepts
Almost all for interview
Thank you very much
Welcome :)
I think there's basic-case a little bit not right, coz n could be < 0, so you need make n
wont it be (n-1) in the skip case?
op sir ji
Why do we start from last element of array (N-1)? Naturally I will start from 0th element of array till N-1. Are there any benefits or challenges in thinking reverse?
You can start from beginning. No problem
i am getting wrong solution with the base case N==0, it wont calculate the 0th i of the array (the first element). putting n
Your video is very clear thankyou for making it. However i am trying to adapt it in order to save the optimal configuration the recursion find. With your code I only have the maximum profit but the configuration is transparent. I thought abour builind a binary tree but i am struggling with it. Would someone has an idea?
Hi. Building a binary tree ? Why
@@techdose4u I want to keep the optimal decision tree. I understand that with your algorithm I have the maximum possible profit but i don't know wich configuration leeds to this maximum profit.
I don't know if the binary tree is the good solution but it is just the intuition I've had. Each decison ( 'take it' or 'not take it') would create a new branch. When the algo is over, I would just have to parse the good configuration from the tree.
Make a video on painter partision problem its difficult to solve
Already made
14:06 if we skip the item, the profit will obviously be lesser of the included right?
Or...
Skipped item will recur to its previous items and return the profit?
Do you have the code in any git repo or somewherer...?
If we use this in any online contest it is able to pass all the test cases??
As the time complexity is 2power(n)
No it won't pass all test cases anywhere. For that you need to use DP. I will be explaining how to write DP code in next video.
sir I am not form cs background , so how much time it will take to cover cs subjects for placement preparation. I have watched your video in which you said to complete them in 2 days per subject. Will 2 days be sufficient for a placement in big companies. Please reply.....
You will need longer time. 2 days is just for revision. You can finish a subject in 10 days.
@@techdose4u thanx sir
..
Sir, I think the same could be done using backtracking 🤔
Hey, Are you planning/giving any private tuition ( one-one online or in-person ( especially focusing on the effective c++ by Scott Meyers approach ) on C++? If it is so, is it possible to send you a private message to discuss further?
💚
Thanks 😊
wow
😊
in recurssion can we start from i=0 to i=N-1
the approach is same as printing all subsequence of a string
👍
👍
Shouldn't the basecase be this??
if(n
I changed input as weights {4, 3, 2} and profit {7, 6, 8}
Output:
14 when n==0
15 when n
wow
Recursion is indeed hard.. No matter how many times I have seen them and used them I am still so scared of them.... 啊😔😔😔
Recursion is all about visualisation. Once you can do it, recursion will feel as easy as bruteforce method :)
base case should be N==-1 || W == 0
understand everything but i cant understand the else case
pls dry run the code with some example:)
Else case has 2 options. You can include or exclude a current item. We will take that option which gives us maximum profit.
If weight of current element is greater than the available space, then skip it.
If no of elements becomes 0 or the knapsack becomes full, then return;
Else we can either include current element and go to furthur processing or we can skip this current element and go to next element for processing because this element may give us lower profit compared to other elements
@@spetsnaz_2 oh ok i understand ;)
@@techdose4u thanks :)
@@spetsnaz_2 how to check the may part?? May give lower profit part?? Can somebody tell me about the max method plz?
Profit(n) should be Profit(n-1).
Great explanation! However, this approach doesn't reveal the correct combination of items, only the maximum profit to be had by choosing those items.
6 months roadmap please to crack google for 2020passouts
Thank you so much