Longest increasing subsequence

preview_player
Показать описание
This video explains how to find both the longest increasing subsequence length along with the subsequence itself. This is the simplest explanation along with logic. This is a very frequently asked programming interview question. The code for reference is present in the description section below, so please check it out. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

Рекомендации по теме
Комментарии
Автор

You must be very proud of yourself for creating such great contents. Thanks. You are a big help. Keep up the good work. Our community needs you.

mrinalraj
Автор

Great explanation! Please upload the o(N*logN) approach.

fanigo
Автор

at 7:16, "If you think about it, you will get it yourself". Instead of calling out names of variables, arrays and reading out every number in the array, time should be spent wisely to explain the "intuition" behind the logic - That's more important than syntax.

vijayakumareyunni
Автор

can u make a video for this problem in O(nlogn) complexity by using dp+binarysearch by the way ur explanation is brilliant ur voice quality and picture quality is great thanx fr this type of help

ANKURSingh-yllj
Автор

second part(finding the sub sequence) is wrong.
what if the arr is [99, 100, 1, 2, 101, 3]
then lis array will be [1, 2, 1, 2, 3, 3]
now according to you LIS should be 1, 2, 3 or 99, 2, 3 or 99, 100, 3 or 1, 2, 101 or 99, 2, 101 or 99, 100, 101.
and many of these are wrong.
Please correct me if I am wrong or I miss understood anything.

PankajKumar-ftlc
Автор

please make videos on some of the questions of "must do interview preparation" from geeksforgeeks.. because it has quality questions and solution is not available on youtube.. by the way your explanation is just awesome.. thank you for the videos

AmanKumar-htxi
Автор

Recursion with Memoization time complexity is also O(n^2)

prodiptamondal
Автор

Not very efficient algorithm. Its be done in nlogn. But still nice explanation 👍.

shreyyy_marwaha
Автор

Youtubers have made soo much buildup for this problem you killed it man...🔥🔥 Thanks

jaswantrohila
Автор

You are very interactive with us despite having a good number of views you make sure to clear each and everyone's doubt. Thank you.

amanrai
Автор

Thank bro. I was just worried about the length of video. But now it doesn't matter.

amandarash
Автор

really good explanation..but it would be more helpful if you also start with recursive approach and slowly convert it into a dp..if video length if the problem you can make it in parts..it would be more helpful for beginners like me to solve dp problems.... Overall a very good explanation..

techamet
Автор

Great to see you also covered the variation of this problem where we need to return the subsequence itself instead of longest subsequence length.

dev-skills
Автор

the longest increasing subsequence can also be 5, 8, 7, 9

Pooh____
Автор

Can you cover the solution with n(log n) complexity?

Somaanil
Автор

There is a binary search approach also which is O(nlogn)

hitengoyal
Автор

nice explanation. Thankx a lot for this.
KEEP IT UP!!.

rishabhkumar
Автор

For the variation. If we have array as 10, 5, 11, 6, 9
Here the lis array would look like: 1, 1, 2, 2, 3
But when we trace back for string of longest increasing subsequence then as said the array would go by taking 9, then we could either take up 6 or 11, but taking 11 would be wrong subsequence.
I dont know if I am missing something. Though thanks for the explanation.

oreoshake
Автор

We can sort the sequence and find lcs of the sorted and original array.. i guess it will also work here...

ServingTech
Автор

Can you please make a video on this problem with binary search and dp and O(nlogn) complexity with c++ code? Thank you :)

aradhayaarora