I know Im asking randomly but does someone know of a way to get back into an instagram account? I somehow forgot the login password. I appreciate any tricks you can give me!
The demo with the card is where exactly I understood "How the algorithm works?". Before watching this video, went through various other videos but couldn't understand the pointer concept correctly. A little graphical content makes learning better. Thanks for this video
Thanks! Believe it or not, I started this channel because I could not find a tutorial on how to solve the Longest Increasing Sequence in O(n log n). This was the very first video. Now I am just exploring subjects that I find neat, or I am simply curious about. Stay tuned and I hope you'd find other episodes interesting as well!
Haha, thanks for the compliment! Yeah, the last name is a bit of a spelling conundrum... It should have been spelled "Veeolentyev", but I guess when my family was immigrating, no one knew enough English to crosscheck for possible word/meaning collisions =)
Phenomenal explanation of LIS! I couldn't find any video describing why patience sort actually works for LIS! Amazing work sir! Thank you for your time and contribution for spreading the knowledge.
Thank you for the compliment! One thing I forgot to mention in the video is that a complete implementation of it using Java is linked in the description.
Brilliant explanation. Getting to understand the intuition behind algorithms is what gets me to truly appreciate computational thinking. These videos are orders of magnitude more beneficial than explanations of only the implementation. Thank you.
I have much appreciation for the one making this video. The algorithm is very simple with image illustration making things easy to understand. Even though, I think there is a problem in your proof. The main thing needs to be hold is "the longest increasing subsequence." "Card n+1 must go into some pile on the right" doesn’t lead to anything
@@PhoenixRisingFromAshes471 I hear you. There are definitely a few DP algorithms that are on my to-do list. I try to prioritize those for which I could not find a good, succinct tutorial. And especially the topics that people asked for specifically.
Great to hear that my little video made such a good impact! I am also a little surprised that this problem would be on a final exam... This is not an easy problem to figure out in a time frame of an exam... In any case, cheers!
Really good explanation! Watched twice and finally understand the concept. I like your example and pace of talk (very calm, clear but also cheerful, and the pauses is neat). Subscribed!
Nice explanation. Thanks. For the case where an element is equal to previous, we can just point to the same place where the previous element had pointed to. Ofcourse, this is when you want longest increasing subsequence. If you are looking for longest non-decreasing subsequence, just point to the equal element itself.
This video is the best explanation for the longest increasing subsequence I have seen. Thank you a lot for it, I enjoyed a lot, and we hope we can see more videos from you.
Thank you. I am looking for an explanation for "splitting non-negative integer array to m subarray while minimizing the largest sum among this m subarray".
Agreed and thanks for the feedback. This was my very first video. Most episodes that followed do have a code walk through. By the way, there is a source code linked in the description.
Brilliant! The way you illustrated the problem with cards, piles and pointers in such a neat and timely matter finally made me understand the logic needed to find the Longest Increasing Subsequence! I struggled a bit to actually implement the algorithm, but now that I have I feel like I've gained the mastery needed to explain this to others if need be. Well done! As for suggestions, what about the Partition problem where the goal is to divide an array of integers in two such that the sums of the two array parts are as equal as possible? I would love an explanation of that!
I am glad to hear it =). And thanks for the suggestion about the partition problem. I haven't heard it before and it sounds interesting. I'll give it a shot!
@@highruler2786 Yeah, it's fascinating stuff. I am currently playing around with algorithms for partitioning into not just 2, but M number of partitions. And this turns out to be also a very interesting topic. It has practical implications, such as operating system handing out tasks to M number of CPUs on a computer, with each task having some specific cost. Thanks again for suggesting the topic!
@@stablesort That's very cool! I'll be sure to see what you come up with in your next episode. And you're very welcome. Is so nice to see your explanation of a problem I've struggled with.
@@stablesort Sir, videos on the following topics will be very helpful. 1.Optimal Binary Search Tree. 2.Huffman Decoding and encoding 3.Assembly Line Scheduling 4.Maximum Bipartite Matching 5.Push Relabel Algorithm(Related to flow algorithms) 6. Johnson's Algorithm(Shortest Path) I hope its not too much!
@@puneetkumarsingh1484 This is perfect, thank you. Some of these I only have a vague recollection of so it'll be fun for me to research into. By the way, as far as Optimal Binary Search Tree topic, one of the ways to achieve this is via "Treap" data structure - you may be interested in viewing this video I made a while back: ua-cam.com/video/uwWOUAdOTig/v-deo.html
@@stablesort I have checked the algorithm and seems self explanatory , just a suggestion can replace m = l + (r - l) / 2; to m=(l+r)/2 ie., (low+high)/2 since the previous is confusing.
They both work when l and r are small compared to the range of the data type used, but m=(l+r)/2 will cause overflow for large values while l + (r - l) / 2 will not. That's why that one should be used in real code.
@@CrazyDreamer1001 Good point! Perfect example of the need to do peer code reviews and testing. I totally did not think about that scenario. Thanks for pointing this out.
You earned a sub sir :) You have a way of teaching I suggest you to pick difficult/ tricky questions from leetcode and start explaining on your channel. I guarantee you, your channel will explode.
I know binary search was mentioned at the end but it would have been nice to explain with the visualization that since the top card on the piles are strictly increasing, we can do binary search over them to find the next pile, which is how we can guarantee O(nlogn) time.
its really nice explanation.but I wanna know how to write a code.so it would be better to show your code examples. Anyway, its the best explanation I've ever watched!!Thank you!!
Thanks for the suggestion. Most of my other videos do discuss the specifics of implementations. For this one, however, the source code is linked in the description.
Could someone explain how we can retrieve the Longest Increasing Subsequence(LIS) from the piles formed above? I did not understand the pointer concept thoroughly, though I understand that there will be Longest Increasing Subsequence(LIS) in the above decks. To be more precise, how do we determine which card we pick from each pile to be included in the LIS? Thanks in advance!
If someone's not convinced, think of it this way: You can never include 2 numbers from the same pile in an increasing subsequence. If I take A and B from the same pile (and let's say B came after A), then B
Thank you, I do appreciate your feedback. This was my very first video made. Since then pretty much all of the other videos have some code walk through. Cheers!
How can we keep a linked list of actually LIC (or any ds) with the simpler solution (7-8 line solution where we just have a piles[])? How to capture the left pile element when a new pile is created? Also, will it ot not break when the first element of a new pile is pointing to the top (at that time) of the left pile and then this current pile has another element later on top which was pointed from yet another new pile top element on its left? e.g. [10, 5] [8] here 8 → 5, but then later the top elements of these two piles are [5] [8] and 6 comes so it becomes [5] [8, 6] i.e [5] [6] as only top element is visible and then 7 comes, so we have third pile now [5] [6] [7] which is pointing to 7→ 6? Do we do linked list insertion now?
Thanks for your question. As each card is placed on some pile, you also store a pointer from that card to whatever is the current top most card of the pile immediately on the left. Later on, there may be more cards added to both of those piles but the original pointer is still liking up the original two cards. The source code of a fully functional Java implementation is linked in the description, but here it is again: bitbucket.org/StableSort/play/src/master/src/com/stablesort/challenge/LongestIncreasingSubsequence.java I hope this helps!
1:22 "To understand how it works, let's develop our intuition..." Man, I wish more math and computer science teachers would be better at this.
I hear you. Thanks for leaving a few good words.
I know Im asking randomly but does someone know of a way to get back into an instagram account?
I somehow forgot the login password. I appreciate any tricks you can give me!
so true, this is the most important part to understanding and it is usually completely skipped over for some reason
Such a wonderful explanation in such less time, I have already wasted 20 min of reading in order to understand this, but understood it, in just 5 min.
The demo with the card is where exactly I understood "How the algorithm works?". Before watching this video, went through various other videos but couldn't understand the pointer concept correctly. A little graphical content makes learning better. Thanks for this video
Awesome, thanks for the good words!
I cam here from other channel's comment section,
Not going back now...
I am glad to hear that you found this video useful =)
Lol. Let me guess... Tushar Roy??
@@mindyourbusiness46 😂
@Hank Hudson Okay stop sending this same message to every educational video. or are u a bot.
Awesome. That’s the best explanation of finding the longest increasing subsequence I’ve seen. Thanks for the video!
I like how 100th of club is designed
I am more of a software engineer and not much of a graphics designer so I am happy to hear that the image made sense =)
There are only 2 UA-cam videos explaining the problem in O(nlogn) time. Your explanation is very clear and you are awesome!
Thanks! Believe it or not, I started this channel because I could not find a tutorial on how to solve the Longest Increasing Sequence in O(n log n). This was the very first video. Now I am just exploring subjects that I find neat, or I am simply curious about. Stay tuned and I hope you'd find other episodes interesting as well!
@@stablesort THANK YOU SOO MUCH!!!!!!!!!
I can't believe 23 people have disliked this video. In my opinion, this is the best possible explanation for this solution. Thanks for the video !!
Glad you liked it!
I keep coming back to watch this again time over time. The best explanation of the algorithm of all time.
Thanks, I do appreciate your feedback!
this channel is so underrated
I really appreciate the graphics, and your calm voice. You are very relaxed for someone whose last name is VIOLENTey
Haha, thanks for the compliment! Yeah, the last name is a bit of a spelling conundrum... It should have been spelled "Veeolentyev", but I guess when my family was immigrating, no one knew enough English to crosscheck for possible word/meaning collisions =)
Haha that sounds like an algorithm problem in itself!
@@nobsreviews8814 True! 8-P
I solved it. I understood the problem after looking at your cards example, the example made this algorithm clear for me.
Glad to hear that it was helpful!
the best explanation so far for longest increasing subsequence problem in nlgn time.
I do appreciate your good words! Cheers!
Phenomenal explanation of LIS! I couldn't find any video describing why patience sort actually works for LIS! Amazing work sir! Thank you for your time and contribution for spreading the knowledge.
You are very welcome! Thank you for such a wonderful compliment!
Simple, concise and the best explanation of longest increasing subsequence! Subscribed :) We need more of this!
Thank you for the compliment! One thing I forgot to mention in the video is that a complete implementation of it using Java is linked in the description.
Brilliant explanation.
Getting to understand the intuition behind algorithms is what gets me to truly appreciate computational thinking.
These videos are orders of magnitude more beneficial than explanations of only the implementation.
Thank you.
Glad to hear it and thanks for the compliment!
I have much appreciation for the one making this video. The algorithm is very simple with image illustration making things easy to understand. Even though, I think there is a problem in your proof. The main thing needs to be hold is "the longest increasing subsequence." "Card n+1 must go into some pile on the right" doesn’t lead to anything
Awesome explanation.. Even a laymen can understand the logic thats what a good teachers does.. Thanks a lot for explaning in Easy way and with game
Thanks for the compliment! Glad to hear that you enjoyed the video =)
WOw sir,you made my day.I came to your video after the lonegest sub sequence problem
Thanks! Your comment gives me inspiration to make more videos! By the way, any suggestions as to what topic to cover next?
@@stablesort you should make more videos on other algorithmic paradigns like greedy,dynamic programming (mainly cause i sucks at dp)
@@PhoenixRisingFromAshes471 I hear you. There are definitely a few DP algorithms that are on my to-do list. I try to prioritize those for which I could not find a good, succinct tutorial. And especially the topics that people asked for specifically.
thank you kind man for preventing me from failing my final semester of CS
Great to hear that my little video made such a good impact! I am also a little surprised that this problem would be on a final exam... This is not an easy problem to figure out in a time frame of an exam... In any case, cheers!
Hands down, the best explanation I've seen on UA-cam
Really good explanation! Watched twice and finally understand the concept. I like your example and pace of talk (very calm, clear but also cheerful, and the pauses is neat). Subscribed!
Sweet! Thanks for the feedback and thanks for subscribing!
Nice explanation. Thanks.
For the case where an element is equal to previous, we can just point to the same place where the previous element had pointed to.
Ofcourse, this is when you want longest increasing subsequence.
If you are looking for longest non-decreasing subsequence, just point to the equal element itself.
Good point!
Damn, that's impressive.
Most dp algorithms are n*m, so n log n is a nice improvement!
best explanation of this problem so far I came across
Thanks for the compliment!
This video is the best explanation for the longest increasing subsequence I have seen. Thank you a lot for it, I enjoyed a lot, and we hope we can see more videos from you.
Thanks for the compliment! I am working on the next one as we speak. By the, if you have suggestions for video topics, please do let me know. Cheers!
Thank you. I am looking for an explanation for "splitting non-negative integer array to m subarray while minimizing the largest sum among this m subarray".
@@stablesort The DP solution, there are not enough contents only for the DP solution.
@@SeyhunSaryldz Roger that. Thank you for the suggestion (as well the one about DP content).
Never got disappointed whenever I spent n minutes of time on this channel where 0
Glad to hear that there was at least 1 minute that was worthwhile =)
Great explanation! Thanks for demonstrating why the algorithm provides the optimal solution.
Thank you for including proof of correctness in your video. It really helped convince my stupid little brain
Please keep posting more videos. Every video is top quality.
Thank you, will do!
Came here from the comment section, a short tour of code would've been better. Loved the video thanks
Agreed and thanks for the feedback. This was my very first video. Most episodes that followed do have a code walk through. By the way, there is a source code linked in the description.
I watched it 3 times and finally understood!!
This video was awesome :) (u earned a sub!)
Great!
One of the best explanation on LIS with time complexity of nlogn. Thanks in advance❤🙏🏼
probably the clearest explanation I've seen. Thanks!
Thanks for the compliment!
What a peaceful explanation.
I hope it was useful!
Crisp, Clear & Brilliant!
Glad you enjoyed it!
Appreciate the brief video. Action packed!
Thanks, I appreciate your compliment!
Great video. U should do more, their quality is ideal and very much needed
Thanks for the words of encouragement!
Wow !!
A lot of thanks, I've been searching for 2 hours, your explanation is short and so clear.
You are amazing !
Brilliant! The way you illustrated the problem with cards, piles and pointers in such a neat and timely matter finally made me understand the logic needed to find the Longest Increasing Subsequence! I struggled a bit to actually implement the algorithm, but now that I have I feel like I've gained the mastery needed to explain this to others if need be. Well done! As for suggestions, what about the Partition problem where the goal is to divide an array of integers in two such that the sums of the two array parts are as equal as possible? I would love an explanation of that!
I am glad to hear it =). And thanks for the suggestion about the partition problem. I haven't heard it before and it sounds interesting. I'll give it a shot!
Here you go, as promised: ua-cam.com/video/7BynUy5ml0I/v-deo.html
@@stablesort That's awsome! I'm glad you also found the easies hard problem interesting :) Great video!
@@highruler2786 Yeah, it's fascinating stuff. I am currently playing around with algorithms for partitioning into not just 2, but M number of partitions. And this turns out to be also a very interesting topic. It has practical implications, such as operating system handing out tasks to M number of CPUs on a computer, with each task having some specific cost. Thanks again for suggesting the topic!
@@stablesort That's very cool! I'll be sure to see what you come up with in your next episode. And you're very welcome. Is so nice to see your explanation of a problem I've struggled with.
awesome explanation to give the intuition, now I just have to think about finding the right pile in logn for each card, and nice shirt btw!
Please, keep making videos. Your explanations are the best
I love this channel and how complex algorithms are explained so clearly....Thank you SO much!! And please keep adding more videos.
Thank you! Will do!
Extremely Clear Explanation! Please upload lots of these.
Thanks for the compliment! By the way, if you have suggestions as to what other comp. sci. topics you'd like to view, please do let me know. Cheers!
@@stablesort Sir, videos on the following topics will be very helpful.
1.Optimal Binary Search Tree.
2.Huffman Decoding and encoding
3.Assembly Line Scheduling
4.Maximum Bipartite Matching
5.Push Relabel Algorithm(Related to flow algorithms)
6. Johnson's Algorithm(Shortest Path)
I hope its not too much!
@@puneetkumarsingh1484 This is perfect, thank you. Some of these I only have a vague recollection of so it'll be fun for me to research into. By the way, as far as Optimal Binary Search Tree topic, one of the ways to achieve this is via "Treap" data structure - you may be interested in viewing this video I made a while back: ua-cam.com/video/uwWOUAdOTig/v-deo.html
@@stablesort Thanks I will surely watch it. Other than this, I know that it is also solved using Dynamic Programming.
This was awesome. Simple and clear explanation. Do more videos plz. Thank you.
Thanks, will do! By the way, got any suggestions for a topic? I am always looking for a subject that hasn't been done yet (or done by not well)?
the best explanation i've seen so far, very good job!
Thanks for the compliment!
Very well explained , and with good examples. Thanks for your effort.
Glad to hear it!
This is so cool! I lost an exercise in a contest because I had to use segment trees, and those are awful. - I wish I had known this! 😅😅😅
I have rarely had this much fun learning a difficult algorithm like this. Hope you expand your operations. 😁
Thanks! =)
Me too
The name of this channel is vety interesting. . . *Stable Sort* 😀
Yeah, perhaps I should actually make a video on what it means =)
Greatest Explanation Ever I saw
Awesome explanation of concept behind algorithm, which helps in coding and remembering algo easily , Please continue the great work
Thanks for the compliment. In case you need it, there is also java source code, linked in the description. Cheers!
@@stablesort I have checked the algorithm and seems self explanatory , just a suggestion can replace m = l + (r - l) / 2; to m=(l+r)/2 ie., (low+high)/2 since the previous is confusing.
@@manojkvn2632 Done, thanks for the suggestion. I like your formulation better =)
They both work when l and r are small compared to the range of the data type used, but m=(l+r)/2 will cause overflow for large values while l + (r - l) / 2 will not. That's why that one should be used in real code.
@@CrazyDreamer1001 Good point! Perfect example of the need to do peer code reviews and testing. I totally did not think about that scenario. Thanks for pointing this out.
beautiful explanation
Kindly keep uploading more such concept
Thanks! By the way, please do let me know if there is a subject that you'd like me to make a video about. I am always looking for new ideas. Cheers!
This is an amazing explanation! Thank you so much for the intuition section!!!!
You are very welcome!
Great set of videos with clear and succinct explanations. @Andrei, any plan to add more content in the future?
I have the plans just haven't had much time lately... But I definitely want to add to the series.
Beautiful explanation.
Thanks for watching and leaving a compliment!
It's a really amazing way to explain. I really loved it. Please keep up this good work.
Thank you! I'll do my best as time permits =)
Excellent video ! Please keep making more of these.
Great video, very helpful to understand the concept of increasing subsequence.
Amazing explanation and insightful illustrations! Thanks a bunch!
You're very welcome!
the explanation was just amazing
You earned a sub sir :)
You have a way of teaching I suggest you to pick difficult/ tricky questions from leetcode and start explaining on your channel.
I guarantee you, your channel will explode.
That's a great suggestion, thanks! If only I could have more time these days for hobbies =)
I know binary search was mentioned at the end but it would have been nice to explain with the visualization that since the top card on the piles are strictly increasing, we can do binary search over them to find the next pile, which is how we can guarantee O(nlogn) time.
Thank you, I loved this video. It was short and simple.
Thank you so much!! Such a clear explanation!
You are very welcome!
man this solution is so good
MAKE MORE CONTENT.
Great work.
Thanks! More episodes are in the making =)
its really nice explanation.but I wanna know how to write a code.so it would be better to show your code examples.
Anyway, its the best explanation I've ever watched!!Thank you!!
Thanks for the suggestion. Most of my other videos do discuss the specifics of implementations. For this one, however, the source code is linked in the description.
@@stablesort Oh!Sorrry!I missed it!!Thank you so much!!!
Great, I just coded this up! :)
Could someone explain how we can retrieve the Longest Increasing Subsequence(LIS) from the piles formed above? I did not understand the pointer concept thoroughly, though I understand that there will be Longest Increasing Subsequence(LIS) in the above decks. To be more precise, how do we determine which card we pick from each pile to be included in the LIS?
Thanks in advance!
Thank you for clear explanation.
Thanks! This is the best explanation I ever had
Glad it helped!
Really great video, lot of insight provided there!
Great to hear!
If someone's not convinced, think of it this way:
You can never include 2 numbers from the same pile in an increasing subsequence. If I take A and B from the same pile (and let's say B came after A), then B
Brilliant!! Thank you.
thanks for such a wonderful explanation
I am glad you liked it =)
Awesome work. Thanks!
Cheers!
Thank you a lot for the video! Why you have stopped posting videos? They are amazing!
very good explanation.
it will be great if you also show code.
find link of this video in leetcode LIS solution discussion
Thank you, I do appreciate your feedback. This was my very first video made. Since then pretty much all of the other videos have some code walk through. Cheers!
if we wanted to sort using this strategy, it would take nlogn to make the piles plus O(max pile size) to merge the k piles right?
Very good explanation, thank you.
Thank you so much for making those amazing videos.
Thanks for the compliment!
Very well explained , thanks a lot:)
Thanks for watching and thanks for leaving a nice comment =)
Nice done!
Thanks!
Great video. Please upload more videos)
Nice video
Thanks, Gagan!
FINALLY,!!!! i understand this :D, this video helpme a lot, thanks : )
Amazing videos! Can you make one about Manacher's algorithm on longest palindromic substring?
Thanks for the suggestion, I'll look into it!
very nice! thank you!
You are very welcome!
Very good vieo, thank you for that simple explanation!
Спасибо за комплимент!
How can we keep a linked list of actually LIC (or any ds) with the simpler solution (7-8 line solution where we just have a piles[])? How to capture the left pile element when a new pile is created? Also, will it ot not break when the first element of a new pile is pointing to the top (at that time) of the left pile and then this current pile has another element later on top which was pointed from yet another new pile top element on its left? e.g. [10, 5] [8] here 8 → 5, but then later the top elements of these two piles are [5] [8] and 6 comes so it becomes [5] [8, 6] i.e [5] [6] as only top element is visible and then 7 comes, so we have third pile now [5] [6] [7] which is pointing to 7→ 6? Do we do linked list insertion now?
Thanks for your question. As each card is placed on some pile, you also store a pointer from that card to whatever is the current top most card of the pile immediately on the left. Later on, there may be more cards added to both of those piles but the original pointer is still liking up the original two cards. The source code of a fully functional Java implementation is linked in the description, but here it is again:
bitbucket.org/StableSort/play/src/master/src/com/stablesort/challenge/LongestIncreasingSubsequence.java
I hope this helps!
good one
Thanks!
2:45 what if the cards are [100, 10, 5.....] , then choosing left most will not allow the wide range of cards to place?? what to do in that case
perfectttttt.........
I am glad to know that the video helped!
Subscribed!
Welcome aboard!
You are the goat
good channel
Спасибо
Не за что!
If you think you didn't understand the video simply replay.
Cheers =)