Sir your explanation is too much above from paid courses and also in your video i never get a doubt or if i get then you always cleared doubt by yourself later in video thanks a alot sir for providing free quality education 🙏🙏👍👍👍👍👍
Thanks for presenting this problem so orderly, going from the decision making tree, to the recursive approach to end up translating that into the tabular iterative approach. Now this is no more black magic for me, but step by step sound reasoning. Like others said your capacity to explain these complex solutions is just brilliant and far superior to paid courses.👏🏼👏🏼👏🏼
Thanks for the explanation. It gives me an idea on how to come up with bottom up solution for dp problems . It would have been great if you had covered why we are considering items from right to left. I sat for couple of hours thinking about it and finally, I could understand the benefit of considering items from right to left over left to right
When deciding about which one to go ahead with Memoization or Tabulation methods. Try to identify the no.of values in the DP table or array that is required to solve the problem. If the number is very less compared to the total size, then go ahead with Memoization for better time complexity because in the Tabulation method it'll compute the whole table, then give you the output. And yeah, if the number of values that need to be computed in the table or array, is not very small when compared to the total size, then yeah go ahead with tabulation. Credits: GFG
Hello sir, I have one doubt, in this process we're actually moving from bottom to up ....like n=0, W=0. then why are we calling it *top-down* approach? It should be called *bottom-up*
You and Aditya Verma both have explained DP thoroughly and both have messed up at same concept i.e. Mistaken Bottom-Up as a Top-Down approach. Did both of you shared same notes or what???
I have solved most of dp problem using recursion and memoization .i felt memoization dp is easier than tabalization . Should I learn tabalization dp ???
Not really. Tabulation/Iteration is Bottom-Up even if you interate in decreasing order. Recursivion+Memoization is Top-Down even if your recusion is in increasing order.
I get that this method gives you the total profit at the end of the table -- but how do you determine which of the elements in the set were selected to arrive at that sum?
your approach to get maximum value is direction which is from right to left. But your table structure is left-top to right bottom to find maximum value. It's confusing... am I misunderstanding?
Friends, can someone explain in which case memoization will be useful because unlike Fibonacci I dont see a case where same value/computation can be repeated because in each case weight may be different
A bottom-up algorithm "starts from the beginning," while a recursive algorithm often "starts from the end and works backwards" . That's why recursive algorithm is known as top down . U wrongly interpreted this top down Approach. It may be Bottom-Up approach. Please Make it clear.
You copy pasted content of Mr Aditya Verma in English, just...even his calling of bottom up as top down is copied man....do some original work please 🥺🥺
dp[i][j]= max( dp[i-1][j], profit[i-1]+dp[i-1][*j*-wt[i-1] ) you specified W instead of j while including the element in final else statement.
Yea right. It should be j.
@@techdose4u Its okay...concepts are more important than code..
@@techdose4u What if j i wt[i-1] will be smaller than 0? Generally index out of bound?
@@Nieobliczalny1000 We prevent this case in this line if (i == 0 or j == 0) dp[i][j] = 0
Stop copying and pinning aditya verma's code Sakthim
saw an algoexpert ad before the video. Am I buying that course after knowing that Techdose has covered 5 X more problems than Algoexpert ?
within 2 or 3 yrs you will have millions of subscribers, great channel.
Thanks :)
Best video on UA-cam explains Knapsack problem with clear way,thanks
Welcome :)
Thanks a lot man.
This is my 4th attempt to understand knapsack DP and also the last one.
Nice :)
Congrats! Never quit!
Sir your explanation is too much above from paid courses and also in your video i never get a doubt or if i get then you always cleared doubt by yourself later in video thanks a alot sir for providing free quality education 🙏🙏👍👍👍👍👍
Welcome bro :)
Never knew about heap Vs Stack memory thanks much for in-depth explanation!
Welcome :)
the sheer clarity of the explanation
Thanks for presenting this problem so orderly, going from the decision making tree, to the recursive approach to end up translating that into the tabular iterative approach. Now this is no more black magic for me, but step by step sound reasoning. Like others said your capacity to explain these complex solutions is just brilliant and far superior to paid courses.👏🏼👏🏼👏🏼
Your intuition explanation is on another level
Another masterful explanation. If I could subscribe twice, I would.
❤️
This is the best explanation i ever came across..
How can u be so clear in every single word u say. awesome bro !!
Thank you so much for the explanation. I was struggling with converting recursive to iterative code. This helped me a lot.
Nice :)
Thanks for the explanation. It gives me an idea on how to come up with bottom up solution for dp problems . It would have been great if you had covered why we are considering items from right to left. I sat for couple of hours thinking about it and finally, I could understand the benefit of considering items from right to left over left to right
Can you mention those here?
I think he sorted the profit array in increasing, hence working from right to left.
Your explanation is crisp,clear n short. Very helpful to me . Keep the good work going on man,
this was a bomb video, better than everything I have ever seen
❤️
Your alll vedios are really nice.and it help me alot in my concept buliding thank u so much🙏🙏🙏🙏really good content
Welcome :)
Wow...really amazing explanation💯
amazing bhai kya samjhaate ho mjaa aa gya thanks a lot.
best video i have ever seeen..excellent..thanks alot
Welcome :)
Thank you very much for the accurate explanation.
i almost gave up trying to understand DP in tabulation, but Finally I did understand, Thank you very much bro🥹
Great :) welcome 😃
great series , following this one 👍
Great ❤️
Thanks for this Great Video series!
Your explanation is really good.
Thanks a lot! The best explanation.
Welcome :)
woow man really great..nice job
Thanks
Wait his handwriting on a computer is so pretty. That's just the first thing I noticed. Obviously it's a good tutorial video, too
When deciding about which one to go ahead with Memoization or Tabulation methods. Try to identify the no.of values in the DP table or array that is required to solve the problem. If the number is very less compared to the total size, then go ahead with Memoization for better time complexity because in the Tabulation method it'll compute the whole table, then give you the output. And yeah, if the number of values that need to be computed in the table or array, is not very small when compared to the total size, then yeah go ahead with tabulation.
Credits: GFG
excellent explaination.
amazing video, thank u
Hello sir, I have one doubt, in this process we're actually moving from bottom to up ....like n=0, W=0. then why are we calling it *top-down* approach? It should be called *bottom-up*
You are right. I had made a community post regarding this. Wish you were there 😅 But yea, it's bottom up.
Thank you..🙏❤️
Welcome :)
You and Aditya Verma both have explained DP thoroughly and both have messed up at same concept i.e. Mistaken Bottom-Up as a Top-Down approach. Did both of you shared same notes or what???
Bro I was literally finding the same in comments as I was also confused haha. But no doubt both of them teach very very good.
Well explained!
Thanks
Love You Sir
Thanks 😊
I have solved most of dp problem using recursion and memoization .i felt memoization dp is easier than tabalization .
Should I learn tabalization dp ???
Nice share. Can you point some questions associated with this concept ? Appreciated.
Subset sum problem
How come 'w' in last line is it 'j' b'coz 'j' is capacity of bag?
It will be j because j is current capacity.
Please correct me if I am wrong , the memoization is a top- down approach and tabulation is a bottom up approach .....
While it looks just the opposite but you are correct :)
Sir I'm good at memoisation but I don't have any idea about tabulation coz I nerver used it. Should one know both of them?
Better to know both.
Very nice
Thanks
We start filling table from smaller value to greater value, so this become bottom up approch. Am I right??
Not really. Tabulation/Iteration is Bottom-Up even if you interate in decreasing order. Recursivion+Memoization is Top-Down even if your recusion is in increasing order.
I get that this method gives you the total profit at the end of the table -- but how do you determine which of the elements in the set were selected to arrive at that sum?
use a prev array which will store the indexes of each optimal step. at the end you would get all the elements in your optimal solution
how your concepts are so strong?
Patience and practice
your approach to get maximum value is direction which is from right to left. But your table structure is left-top to right bottom to find maximum value.
It's confusing... am I misunderstanding?
Friends, can someone explain in which case memoization will be useful because unlike Fibonacci I dont see a case where same value/computation can be repeated because in each case weight may be different
THANKS SIR
Welcome
Love you bro
Thank you
too good
Thanks :)
You have messed up the indexes.
A bottom-up algorithm "starts from the beginning," while a recursive algorithm often "starts from the end and works backwards" . That's why recursive algorithm is known as top down .
U wrongly interpreted this top down Approach. It may be Bottom-Up approach. Please Make it clear.
Please make a roadmap for fresher to crack google in 6months
fucking legend
lov u
adore u
:)
You copy pasted content of Mr Aditya Verma in English, just...even his calling of bottom up as top down is copied man....do some original work please 🥺🥺
too lengthy explanation
It was basics so it went long.
lmao then shut up and dont learn
Looks like copied from the videos of Aditya Verma :D , exactly same.......... hahahahahaha