Тёмный

4.9 Longest Common Subsequence (LCS) - Recursion and Dynamic Programming 

Abdul Bari
Подписаться 1 млн
Просмотров 1,1 млн
50% 1

Longest Common Subsequence Problem using
1. Recursion
2. Memoization
3. Dynamic Programming
PATREON : www.patreon.co...
Courses on Udemy
================
Java Programming
www.udemy.com/...
Data Structures using C and C++
www.udemy.com/...
C++ Programming
www.udemy.com/...

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 729   
@LetsBeHuman
@LetsBeHuman 6 лет назад
Give this man a medal. In 23 minutes, he covered all 3 ways and DP with 2 examples. Just couple of suggestions to win much more subscribers 1) For your videos at least allow auto-translate 2) Instead of directly pasting the code, you can do think-out loud and tell us how you arrived at that code. Man, you deserve a round of applause.
@trango1658
@trango1658 5 лет назад
many thanks from MONTREAL xxx
@bipinbhandari8781
@bipinbhandari8781 5 лет назад
True!
@soumilyade1057
@soumilyade1057 5 лет назад
and also, how to code for memorization. One such example would clarify the concept even better.
@narharimotivaras79
@narharimotivaras79 5 лет назад
true bro! Hatsoff to this Man!
@azadalishah2966
@azadalishah2966 4 года назад
Soumilya De Memoization ( not memorisation). It means store the result in data structure of ur choice and read from it in next call instead of recalculating again & again. Thus it become faster. If u r not clear let me know.
@dhruvpatel9957
@dhruvpatel9957 6 лет назад
Attended zero lectures but understood everything from you. I'm a fifth sem student and.....god bless you sir 🤟🤟🤟🤟.
@harshjoshi6257
@harshjoshi6257 4 года назад
bhai lecture bhi par lena
@dhruvpatel9957
@dhruvpatel9957 4 года назад
@@harshjoshi6257 8th sem mai aa gaya bro clg khatam hone ko aayi hai.
@harshjoshi6257
@harshjoshi6257 4 года назад
😂
@sarthakgaba1583
@sarthakgaba1583 4 года назад
😂
@karanbhatia6712
@karanbhatia6712 4 года назад
@@harshjoshi6257 Aye tu jaa re! Yaha bhi aa gaya
@pionerogroup9081
@pionerogroup9081 5 лет назад
I didn't understand anything in my class when my teacher was teaching this topic and I did not even try to understand because I knew that It will be clear only by Abdul sir's videos. You are Great man
@techinframes
@techinframes 6 месяцев назад
so now tell me what didi you understand
@anon00089
@anon00089 18 дней назад
@@techinframes longest common subsequence, duh
@mateussoares7421
@mateussoares7421 2 года назад
Hello Abdul, how are you? I'm writing this comment just to say that I loved you video and I'm very grateful that there're people like you ready to share knowledge for free that's gold!!!! Thank you very much!
@meetshah9510
@meetshah9510 10 месяцев назад
Anyone in 2024?
@arman2998
@arman2998 5 месяцев назад
No 😂
@ivandrofly
@ivandrofly 5 месяцев назад
aye
@IrenJahan-ru5tx
@IrenJahan-ru5tx 5 месяцев назад
Here
@ivandrofly
@ivandrofly 5 месяцев назад
We never left btw
@ayushmishra8084
@ayushmishra8084 5 месяцев назад
No 2069
@TheAndreve
@TheAndreve 4 года назад
From México, I agree with all the previous comments. Your explanation is clearer than my algorithms course. Great job sir!
@saunakroy2587
@saunakroy2587 6 лет назад
Watched all your RU-vid videos from scratch. Teaching in that way, which is simple to understand and will also be quickly absorbed by the students is an ART. You have got this brilliant ART sir. I have grasped all these concepts before college via your videos. Thanks a lot for providing knowledge for free. You are a real teacher and i hope that you will continue teaching us more through your videos.
@praneetsingh9695
@praneetsingh9695 6 лет назад
you are one of the best teacherr ..happy teacher's day sir
@vigneshp9994
@vigneshp9994 3 года назад
So Mr. Abdul Bari has decided to single-handedly save me from all those unhelpful college lectures. Good, Very good. Thank you :)
@DivyanshuShekhar
@DivyanshuShekhar 12 дней назад
I develop, design and lead efforts for various initiatives at Oracle. Even with 13+ years of experience I come back to this amazing man to appreciate his simplicity. Dear Sir, Your simplicity in explanation is infectious. It motivates me to go back to college one more time and appreciate how amazing it is to learn from a teacher like you. God bless you. :) :)
@archardor3392
@archardor3392 3 года назад
Amazing! How come I have never thought of this solution! So trivial it seems but only when presented to you by such a master! Days, no Weeks of confusing and trying it on my own and now I see clarity! Amazing presentation!
@onkartiwari5742
@onkartiwari5742 3 года назад
I did not no about this gem earlier. how easily he explain the things. thank you so much sir. May god give you all the happiness.
@shanthansai6377
@shanthansai6377 4 года назад
The dislikes are from the lecturers/professors who can't teach as good as him.
@ManishKumar-rz9ub
@ManishKumar-rz9ub 4 года назад
🤣🤣🤣
@kapilgupta8543
@kapilgupta8543 3 года назад
No, few dislikes are because he just shows how algorithm works. Instead of showing how one can approach the solution without knowing solution already. Because approaching the solution is more important than mugging up solution. For example, he just showed the code for recursion without explaining one can think of writing that code without knowing the solution already.
@FranVarVar
@FranVarVar 3 года назад
​@@kapilgupta8543 I think that cannot be taught. You just make tables with examples, fill them manually and try to see a pattern. That is my guess but I am not an expert!
@rahmasamy7463
@rahmasamy7463 3 года назад
@@kapilgupta8543 exactly
@foodiebala1434
@foodiebala1434 2 года назад
My madam explained it in more detail like him as well but I am going to these for revision. So, not every teacher is like u all thought if u listen to them carefully they will also cover all these topics
@grasstoucher856
@grasstoucher856 Год назад
You are my role model in explaining concepts Teacher Abdul. Interesting, clear, and well-paced. I can't thank you enough for sharing this for free. I appreciate you and hope one day I can contribute to maintaining your courses.
@bizzey2714
@bizzey2714 4 года назад
I’m doing my master's in CompSci and these videos help me in undersyanding the working of the problems so well -- my prof is so so bad omg
@coopjmz9627
@coopjmz9627 3 года назад
Best algorithm teacher ever! Gotta love the dramatic way you turn to the camera at the end of your videos, when you know everything is explained and all the viewers understood!
@小郭子游戏-v4r
@小郭子游戏-v4r 5 лет назад
too good. I wish all the professor can do and explain like you, so I can understand LCS long time ago. Thank you so much
@madinab3610
@madinab3610 5 лет назад
OMGSH, YOU MAKE IT SO CLEAR. Thank you so much for all your hard work with finding the correct examples and making this video so neat and short, but complete. Thank you soo much!
@shabashachi1238
@shabashachi1238 6 лет назад
Sir, what are subjects , you are teaching? Your teaching method is best. If I listen your video, Then no class, no book is required.
@vikasjha8975
@vikasjha8975 4 года назад
this man is doing great job by helping students with his videos may god fill his all dreams. best wishes )-
@jimmyp4584
@jimmyp4584 5 лет назад
We can’t thank you enough sir. Simply can’t. Such simple and beautiful way of explanation of complex topics.
@chiragsingh9166
@chiragsingh9166 Год назад
The way he teaches is amazing. I failed to understand this topic in my college but you are the man who helped me understanding this topic I m first semester student of BVoc(software development and E governance) Thanks sir 🙏🏻❤️
@mohammedsaadfazal1556
@mohammedsaadfazal1556 Год назад
studying 1 hour before DAA exam thanks to Abdul Bari sir
@sameersondur9030
@sameersondur9030 5 лет назад
I really appreciate your way of teaching. Not even for a moment, you made me feel like this is a very complex topic. I have seen very few teachers teach this way. This makes me think how to communicate better with my colleagues. I think the opposite person should not feel like it is a complex issue.
@aashishdagar3307
@aashishdagar3307 3 года назад
I have tried multiple resources,but you are best sir. Time investing here on this channel is worth. Thanks you sir.
@sarksou
@sarksou 3 года назад
Sir, I saw this video after watching multiple dp youtube video but somewhere there was gap. But you're amazing, from today any topic first I will search in your channel.. You're too good if there is a match add 1 taking value from previous diagonal else max of previous row/colum.. Superb too good.. Bottom up, top down too good. I wish I watch this video before my amazon interview
@andreysaenko9057
@andreysaenko9057 3 года назад
just want to say - WOW. Very clear description of LCS problem.
@nitishroy6538
@nitishroy6538 5 лет назад
Arey ye itna aasaan hai :) sir, huge respect... guru purnima pe apko naman hai
@allahakbar9580
@allahakbar9580 5 лет назад
I am not even a computer programmer and I understand what he's saying! He's wonderful!
@MustafaKHAN-sw1xb
@MustafaKHAN-sw1xb 6 лет назад
This tutorial is better than others
@mirrannas.6892
@mirrannas.6892 3 года назад
After a horrible horrible lesson about this topic and leave with confusion, I am watching this video and finally understand the topic. Thank you so much ❤️
@PhuongNguyen-mg8ss
@PhuongNguyen-mg8ss 4 года назад
Thank you so much, Sir. Your lectures helped me survive in my class during Covid-19:x
@ethanhyde3872
@ethanhyde3872 3 месяца назад
I thought I'd never understand this buy Abdul is an absolute lifesaver. Round of applause
@muzammilmueen3487
@muzammilmueen3487 6 лет назад
Awesome .. The best part is that he spent good amount of time to clarify what is the 'actual problem' he will solve ... 10 / 10.
@Tuscani2005GT
@Tuscani2005GT 4 года назад
Thank you so much for this amazingly clear explanation. If I had to pay in order to subscribe to you I would do so happily!
@vatsraviya470
@vatsraviya470 2 года назад
Thank you sir you helped me in passing my exam
@prashanthikuchana4144
@prashanthikuchana4144 6 лет назад
There are lot of videos on LCS but this the best and clear explanation I've seen so far. Thank you and my respect to you sir.
@nournote
@nournote 5 лет назад
Thanks very much. That was crystal clear. I have a remark though : as far as I know, ameliorating recursion with memoization is still considered DP in the literature.
@AfroMuggleKing
@AfroMuggleKing 5 лет назад
exactly!! dp can be done using tabular method(bottom up) or recursion with memozation(top down). Got confused when he said now will do it using dp.
@mansmor7211
@mansmor7211 Год назад
This gentleman is teaching better than my Uni lecturers. He deserves special thank you.🙏🙌🥇🥇🥇🥇
@Ayushsharma-qc7qx
@Ayushsharma-qc7qx Год назад
Just pure teaching best in the whole universe and also in multiverse 🛐
@AwesomShots
@AwesomShots 2 года назад
Never got this much easy explanation of recursion. Thank you so much sir for the video
@rishabhbandi3368
@rishabhbandi3368 4 года назад
Sir you are God Gifted. By only listening to your videos before exam brings back the confidence. Not everyone can teach as calmly and confidently like you! Thanks a ton for being saviour of so many students.
@kakashisenpai99
@kakashisenpai99 5 лет назад
Those dislikes are from people who are jealous of his easy teaching. Crystal clear explanation sir. Thank you ❣️
@bharataaryavrat4067
@bharataaryavrat4067 3 года назад
can you see my mistake ,i am geeting wrong answer #include using namespace std; #define ll long long // string dp[4001][4001]; vectordp(4001,vector(4001,"")); int main() { string s1,s2; cin>>s1>>s2; ll n=s1.length(); ll m=s2.length(); for(ll i=0;i
@ahmedalif9989
@ahmedalif9989 4 года назад
Just awesome!!!! My university's lecturer was failed to explain it and made it hard for everyone. You make it so easy as possible. Hats off sir!
@Sol3Z
@Sol3Z Год назад
I love you😂 I got this video in my recommendation 1 hour before my exam and this problem was the "hard" task of my exam :)
@niteshyadav247
@niteshyadav247 Год назад
Pay attention to how he uses plain recursion first, then memoization reduces number of calls(2^n --> m.n), and then he uses dynamic programming which is still O(m.n) but it outperforms recusrsions because recursive functions take a lot os space on the call stack and are generally slower tha for loops, every new way of solving the same problem adds to the performance, i used to jump directly to dynamic programming without understanding the problem it solves you can only truly understand(and appreciate) dynamic programming if you're coming from recursion
@crazyprofz
@crazyprofz 8 месяцев назад
Thanks sir, your explanation is awesome. I love how you explain every single step using hand writing. Clear concept, this is all I need, the rest is just need to convert it to any programming language. I hope you are always healthy there
@utkarshpaliwal411
@utkarshpaliwal411 5 лет назад
Sir, you are God. The way you explained the problem moving from Recursion to DP, explaining at each step the ways in which we can better the current solution, helped me understand this question which used to give me nightmares. Thanks a lot !
@poojaarora6912
@poojaarora6912 5 лет назад
Sir, all your videos of ADA are really very well explained. I will pass in my exams only because of you.... Lots of respect and love to you!
@SoyJayP
@SoyJayP 5 лет назад
I understood it right away watching this video after spending a long time to understand it from other blogs.
@chetanraikwar3546
@chetanraikwar3546 6 лет назад
Best videos on programming I ever found on youtube. Thank you sir, your videos are very helpful in competitive programming. :) After seeing your explanations, I can write correct code on my own. . . . ^_^ Lot's of respect. Please make videos on :- 1. Longest Increasing Subsequence 2. Longest Palindromic Subsequence 3. Edit Distance
@Anubis10110
@Anubis10110 6 лет назад
Thank you so much Sir, I really wish you all the best. Easy demonstration and great explanation .. Wish I can give you the Golden Medal in Teaching.
@venkateshnagubandi754
@venkateshnagubandi754 4 года назад
One of the best Teachers for programming on RU-vid
@DridhaNishchay
@DridhaNishchay 4 года назад
You are great Sir. Saviour of all students. Hats off to you. Thank you.
@atheist00123
@atheist00123 3 года назад
Was Trying to figure this algo out. I have never seen anyone teach better.
@ndroidLover
@ndroidLover 6 лет назад
hello sir as u cover all topics of algorithm...now next video series on the most imp domain of IT WORLD that is either IOT,ML,DL AUR AI
@anirudhreddybasani3555
@anirudhreddybasani3555 6 лет назад
Probably u are the only one who have made such a large number of videos on topics related to competitive programming...lots of respect🙌 sir
@nraghu99
@nraghu99 3 года назад
You are the best sir, like someone said, congress has to give you a medal fpr spreading the light
@uditkumar7211
@uditkumar7211 3 года назад
Sir is legend what my teacher couldn't explain in 3 lectures Sir explained in 23 minutes Hats off
@khadijahalsmiere3718
@khadijahalsmiere3718 5 лет назад
you saved my life Sir .. thank you very very very much .. //from KSA .
@koushiknallapuneni2564
@koushiknallapuneni2564 6 лет назад
Dynamic programming 15:05
@nikhilbalwani2285
@nikhilbalwani2285 5 лет назад
@@abdul_bari :)
@umangverma3660
@umangverma3660 5 лет назад
😂😂😂😂
@devangpatel8406
@devangpatel8406 4 года назад
@@abdul_bari are sir 😂😂😂
@lavishgarg4274
@lavishgarg4274 4 года назад
@@abdul_bari aap alag nhi mann rhe ho sir😂😂
@sharifsircar
@sharifsircar 7 месяцев назад
Big Thank you. I don't know how I'd wraping up school if it wasn't for people like you 🙌
@aminurrahmanashik2786
@aminurrahmanashik2786 3 года назад
This man deserves a medal.
@zeroone8137
@zeroone8137 6 лет назад
Simply superb. I felt like your lectures were similar to ravindra babu sir's lectures.Both of them lectures are very useful to understand the concepts very clearly. Hands off
@sazzadhossain2257
@sazzadhossain2257 3 года назад
Thank you sir for your hard work .You are helping students like me all over the world . Great tutorial.
@yessinekammoun1997
@yessinekammoun1997 3 года назад
Lovely explanation, you have just explained in 23minutes what my teacher didn't explain in 2 hours :D
@md.fazlerabbi675
@md.fazlerabbi675 5 лет назад
sir you are best. this ALGO course cost me 24k. but my course faculty even don't know what he is teaching. thnx sir
@nameunknown007
@nameunknown007 2 года назад
5:23 Abdul Bari: Then after that I will show how memorization will make it faster. Me: Memorizing the algorithm intensifies ROFL /s
@mail4soumen
@mail4soumen 4 года назад
Sir, You teaching style is the best till I have seen. I have never seen any other teacher who can explain so nicely. Your is very very much understandable and to the point. I am learning a lot from your RU-vid and Udemy website. Thanks a lot such a wonderful explaining.
@sagarsrivastava1236
@sagarsrivastava1236 4 года назад
Sir you are tooo good.... Loved your videos of Udemy course as well this algorithms course.
@coledrain2158
@coledrain2158 5 лет назад
My lecturer just explained it to us vaguely. But now I see why some things happen. Thank you Sir.
@Mayank612722
@Mayank612722 6 лет назад
In my yesterday's exam, recursion and LCS weighed 24/80 marks. Your other videos really helped me. Thanks. Subbed.
@Mayank612722
@Mayank612722 6 лет назад
Abdul Bari Sir I was revising using your videos all through 18th April night till early in the morning of 19th. Thanks for the work you do. Thank you.
@jamesjassi37
@jamesjassi37 5 лет назад
Sir you deserve dhronacharaya award.... 🙏🙏🙏🙏🙏Bestest explanations
@aryanjaiswal7978
@aryanjaiswal7978 3 года назад
It would be pretty helpful if can you make videos explaining the intution of how do you come up with the algo (code) in these problem, atleast for DP section
@Han-ve8uh
@Han-ve8uh 4 года назад
Very good start, but from 15:30 min on (bottom-up approach), things start to go south. 1. Why does the code have no base case? 2. Why trace values in a table? (if m, n ~ 1 million each, how to do anything from 15:30 min on?) 3. How to programmatically trace the characters in longest subsequence rather than visually looking at a table and drawing horizontal/diagonal arrows back?
@detaaditya6237
@detaaditya6237 5 лет назад
You just saved my final test, thank you sir :')
@NoorFatima-pf1sq
@NoorFatima-pf1sq 5 лет назад
I have no words.. Your teaching style is amazing awesome too good thank you sooo much Sir Allah bless You...…….
@YidanSun-mv3zc
@YidanSun-mv3zc 5 месяцев назад
genius guy, clearly explained the hard question.
@rentedunicorn
@rentedunicorn 6 лет назад
This is the best explanation I have seen for LCS.
@John83118
@John83118 8 месяцев назад
This content is pioneering; much like a book that introduced groundbreaking ideas. "The Art of Meaningful Relationships in the 21st Century" by Leo Flint
@ayushshukla3000
@ayushshukla3000 4 года назад
went to 3 places and here I found the simplest of explanation Thank You Sir
@abhinashjena216
@abhinashjena216 Год назад
Sir your simplicity makes you great. I wish someday i would meet you and touch your feet. 🙏🙏🙏
@prashreetiwasti7264
@prashreetiwasti7264 5 лет назад
I don't know how I would cover my syllabus if you hadn't uploaded videos, your explanation is so clear, thank you from Nepal 🙏🇳🇵
@sujanpaudel2031
@sujanpaudel2031 5 лет назад
pass vainxa ta daa ma aba 😅😅😅
@prashreetiwasti7264
@prashreetiwasti7264 5 лет назад
@@sujanpaudel2031 haha khai,, vagwan janun😂😂
@sujanpaudel2031
@sujanpaudel2031 5 лет назад
sai ho
@ehsanhosseini5861
@ehsanhosseini5861 4 года назад
This is the greatest video I have ever seen. Thank you Abdul, you are the best.
@cpsarathe
@cpsarathe 4 года назад
LC explanation is the best i saw here. god bless you brother .
@talhayusuf2472
@talhayusuf2472 4 года назад
Abdul Bari sir, hats off to you. Love from Bangladesh
@trollerninja4356
@trollerninja4356 6 лет назад
sir please...longest strictly increasing subsequence...you explain things the best out of all of the videos that i saw on some of the tricky topics in algos....so please...
@DentrifixoRam88
@DentrifixoRam88 4 года назад
Best explanation in Internet for LCS
@sfdcfactory4798
@sfdcfactory4798 4 года назад
it can also be solved easily by using iterative approach. s1 = ['a','b','d','a','c','e'] s2 = ['b','a','b','c','e'] if len(s1)>len(s2): temp_list = s2 temp_list2= s1 else: temp_list = s1 temp_list2 = s2 print(temp_list) print(temp_list2) #temp_list.pop(0) #print(temp_list) def combo_finder(temp_list1,temp_list2): str = '' j = 0 for i in range(len(temp_list1)): while(j
@SaiTeja-vq8hq
@SaiTeja-vq8hq 5 лет назад
It was a really great explanation, but you could explain on the approach you took to get to the dp algorithm rather than just saying bottom up and top down!
@hamdancodes7900
@hamdancodes7900 4 года назад
How simply you have taught everything in such a difficult topic... Thank you sir ...
@TravellerMann
@TravellerMann 5 лет назад
In simple words..Its WOW !!! Perfect explanation..
@amitmore4223
@amitmore4223 3 года назад
sir actually i dont understand this concept when i am read it in book but after viewing your video i understand it clearly,nice explained sir,thanks a lot :P
@adithyagowda4642
@adithyagowda4642 3 года назад
This explanation was better than Leetcode premium explanation.
@rhkvineel4098
@rhkvineel4098 4 года назад
Abdul bari sir, super explanation sir, the best ever I had seen in my life.
@khusbhuverma5345
@khusbhuverma5345 2 года назад
Sir, the way you explain everything in detail is exceptional! :) Glad to find your channel! :) Thank you very much for all your videos which are truly insightful! :)
@rudrakshjhalani1681
@rudrakshjhalani1681 4 года назад
Searching for a topic and just hoping to find your video on that, cause no explanation can beat yours!! Thank you sir!
@jesiotra6246
@jesiotra6246 3 года назад
You are the best teacher!
@piyushsharma1638
@piyushsharma1638 6 лет назад
you are awesome sir, reminded of my Teacher in school.
@TheBikerDude2024
@TheBikerDude2024 3 дня назад
Greatly explained. Kudos, Sir.
Далее
4.5 0/1 Knapsack - Two Methods - Dynamic Programming
28:24
Катаю тележки  🛒
08:48
Просмотров 218 тыс.
3.5 Prims and Kruskals Algorithms - Greedy Method
20:12
9.2 Rabin-Karp String Matching Algorithm
23:50
Просмотров 784 тыс.