Hello Ahsan, that’s a good question...I would suggest before answering it that you sort it on breadth and check what difference does it make. Do let me know the findings...I will be glad discuss on this further.
@@joeystechpluscode Thanks for replying and take my question sincerely. length wise neither length>breadth wise and both of the arrangement will give me the same result. ... Is My thinking is correct?
Hi, I had a question similar to this question - if the box had two dimensions - like the russian doll envelopes, we first sort it according to one dimension and apply LIS on the other, if we sort according to area and keep on checking l1>l2 and b1>b2 will that work too?
Hi, 'j' is moved because it denotes the candidates which are used in the process to bring out the optimized solution of the sub problem, whereas, 'i' denotes the sub-problem itself hence, j is moved rather than i
@@fatimarathore752 Hi Fathima, 'i' denotes a particular box and j denotes every box greater than it in area. While comparing 'i' with every j we make sure that we get the maximum height. Box#2 with area 24 can be put on both box#0 and box#1 but keeping on which of them will give it the maximum height? That's what we try to find out by moving 'j'. I suggest you watch the longest increasing subsequence video which will clarify it further for you.
Very well explained , thanks for such videos on dp
Thank you so much
This is the coolest explanation of the box stacking problem I have found on the internet.
Thank you so much
great keep going brother
Thanks bro for the compliment
nice explanation . 5:33 but i have a question why we arranged length and breadth such that length > breadth?
Hello Ahsan, that’s a good question...I would suggest before answering it that you sort it on breadth and check what difference does it make. Do let me know the findings...I will be glad discuss on this further.
Did you try doing it?
@@joeystechpluscode Thanks for replying and take my question sincerely. length wise neither length>breadth wise and both of the arrangement will give me the same result.
...
Is My thinking is correct?
@@ahsanamin3818 You're right and this is what I wanted you to explore.
@@joeystechpluscode thank you so much
Hi, I had a question similar to this question - if the box had two dimensions - like the russian doll envelopes, we first sort it according to one dimension and apply LIS on the other, if we sort according to area and keep on checking l1>l2 and b1>b2 will that work too?
I think it should but maybe I need to see the real question.
How can you solve this problem if the number of boxes is limited to n ?
13:13 why do you move j? why doesn't i keep moving to the right?
Hi, 'j' is moved because it denotes the candidates which are used in the process to bring out the optimized solution of the sub problem, whereas, 'i' denotes the sub-problem itself hence, j is moved rather than i
@@joeystechpluscode hi!can you clarify furthur on what condition you moved j.shouldn't i loop till end for j to move?
@@fatimarathore752 Hi Fathima, 'i' denotes a particular box and j denotes every box greater than it in area. While comparing 'i' with every j we make sure that we get the maximum height.
Box#2 with area 24 can be put on both box#0 and box#1 but keeping on which of them will give it the maximum height? That's what we try to find out by moving 'j'. I suggest you watch the longest increasing subsequence video which will clarify it further for you.
Sir, thanks! Can you provide your mail Id sir?