Maximum Sum Increasing Subsequence | Dynamic Programming | MSIS | LIS

  Рет қаралды 16,586

Techdose

Techdose

Күн бұрын

Пікірлер: 30
@shriyajaswani3400
@shriyajaswani3400 3 жыл бұрын
Thankuh🤠🥺 Understanding these hard problems to a level that you can make others understand it. then thinking out of the best way to explain it and also providing it for free. 🥺
@techdose4u
@techdose4u 3 жыл бұрын
☺️
@space_ace7710
@space_ace7710 5 ай бұрын
Best explanation I found!
@techdose4u
@techdose4u 5 ай бұрын
thanks :)
@ashishranjan4623
@ashishranjan4623 4 жыл бұрын
You should also have gone for NlogN approach. But whatever was there, it was well explained.
@techdose4u
@techdose4u 4 жыл бұрын
Actually my intention for taking this question was to explain it as a variation of LIS.
@ganeshkasar4340
@ganeshkasar4340 4 жыл бұрын
Can you share how this can be solved in NlogN. Because I am not sure if "NlogN approach of LIS" will work here or not
@ashishranjan4623
@ashishranjan4623 4 жыл бұрын
@@ganeshkasar4340 Suppose array is [3,1,4,2] Not we take an array [0,0,0,0,0]. 1. (3) so look at highest value before index 3. we have 0. update [0,0,0,3,0] 2. (1) highest value before index 1 is 0. Update [0,1,0,3,0] 3. (4) highest value before index 4 is 3. Update [0,1,0,3,7] 4. (2) highest value before 2 is 1. Update [0,1,3,3,7] Ho highest value is 7. This is n^2. But u can easily use segment tree to make "search for highest before" a logN operation. What if max in array is too high ? Then just use hash map to do coordinate compression and proceed in same way.
@ganeshkasar4340
@ganeshkasar4340 4 жыл бұрын
Thanks a lot
@RahulKumar-wf9xx
@RahulKumar-wf9xx 4 жыл бұрын
Sir can you please make a video of Maximum product subarray problem as i feel it to be quite confusing and btw i follow your channel regularly !!
@techdose4u
@techdose4u 4 жыл бұрын
I will see it. There are many problems pending :)
@RahulKumar-wf9xx
@RahulKumar-wf9xx 4 жыл бұрын
@@techdose4u Ok Thankyou sir and waiting for new dp problems !!
@suvamroy6205
@suvamroy6205 3 жыл бұрын
@TECH DOSE Yes I need it too!! I am long following up for this problem. Please make video on it.
@sanjeetsingh4743
@sanjeetsingh4743 2 жыл бұрын
Hi thanks for the LIS videos, can you also make the N log N version of LIS ?
@swaroopkv4540
@swaroopkv4540 2 жыл бұрын
where we are checking if subsequence are in increasing order we r checking only element at i is greater than element at j
@impatientgaming9868
@impatientgaming9868 11 ай бұрын
good one
@shanmukhchandrayama8508
@shanmukhchandrayama8508 2 жыл бұрын
is there any solution of o(nlogn) timecomplexity similar to that of lcs in nlogn
@shubham-0152
@shubham-0152 4 жыл бұрын
Sir pls upload videos on c++ stl like comparators, vector, pair, list, set or oops concept
@E__ShameemahamedS-bx2ed
@E__ShameemahamedS-bx2ed 4 жыл бұрын
i=0 prev=min element in array-1 int msis (arr [],i,prev) { if (i==n) return 0 if (prev>arr [i]) // exclusion case return msis (arr [],i+1,prev) else // max of include or exclude return max (msis (arr [],i+1,prev),arr [i]+msis (arr [],i+1,arr [i]) } I tried myself before seeing Ur solution Pls reply will this work?
@E__ShameemahamedS-bx2ed
@E__ShameemahamedS-bx2ed 4 жыл бұрын
Pls reply sir😢
@barunsarraf8863
@barunsarraf8863 4 жыл бұрын
I have one approach
@techdose4u
@techdose4u 4 жыл бұрын
Your approach is LIS :)
@barunsarraf8863
@barunsarraf8863 4 жыл бұрын
@@techdose4u Yes. that is what i can relate to and solved with the same approach taking time n^2
@barunsarraf8863
@barunsarraf8863 4 жыл бұрын
can you help in solving minimum number of jumps to reach end problems, i often face problem in that and forget what approch was used there most of the time
@E__ShameemahamedS-bx2ed
@E__ShameemahamedS-bx2ed 4 жыл бұрын
Pls reply to my code
@E__ShameemahamedS-bx2ed
@E__ShameemahamedS-bx2ed 4 жыл бұрын
Pls reply to my code
Longest Increasing Subsequence NlogN | Leetcode #300 | LIS
21:00
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 7 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
Minimum edit distance | Dynamic programming | Backtracking
28:52
DP - 5: Maximum Sum Increasing Subsequence
25:13
Coding Simplified
Рет қаралды 5 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 8 М.
TCP/IP for Programmers
3:03:31
Eli the Computer Guy
Рет қаралды 231 М.
Edit Distance and its Variations | Dynamic programming
14:02
Techdose
Рет қаралды 10 М.
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1,1 МЛН
DP 41. Longest Increasing Subsequence | Memoization
24:35
take U forward
Рет қаралды 346 М.
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН