Longest common subsequence algorithm -- example

  Рет қаралды 118,790

Daniel

Daniel

Күн бұрын

-----
Video explains how LCS (longest common subsequence) algorithm creates a table to determine an answer.
The longest common subsequence (LCS) problem deals with a question how to find the longest subsequence common to all sequences in a set of (usually) two sequences.

Пікірлер: 168
@bigray712
@bigray712 8 жыл бұрын
you should make more algorithm videos. you're really good at explaining.
@backup3412
@backup3412 Жыл бұрын
Yes we need more
@4blossoms
@4blossoms 10 жыл бұрын
Great explanation. My prof didn't teach it this way, but makes the dynamic programming solution so much clearer!
@abdulwahabalhrbi4908
@abdulwahabalhrbi4908 Жыл бұрын
8 years later and his solution is better than my prof😂
@techvishnuyt
@techvishnuyt Жыл бұрын
@@abdulwahabalhrbi4908 same 😂
@pchebbi
@pchebbi 7 жыл бұрын
Wonderful explanation! You are a great teacher!!!
@shanekhantsoemoe4996
@shanekhantsoemoe4996 6 жыл бұрын
Thank you so much! I want to see more algorithm videos from you as you're really good at explaining them!
@princemaratas3531
@princemaratas3531 7 жыл бұрын
I know it's late but I want to give you a very big thanks. this video really helps me understand how to code the LCS. that I used in Undergraduate Research :)
@ChiranjeevTapas
@ChiranjeevTapas 10 жыл бұрын
can you teach this to my teacher too?? damn she made this so difficult to understand! Dhanyawad(Thank You)!
@TheMoviesManX
@TheMoviesManX 7 жыл бұрын
My teacher is the same !
@anishkhanal5108
@anishkhanal5108 7 жыл бұрын
Yo fckin same here...i hate my teacher
@diandhonalciranjang222
@diandhonalciranjang222 6 жыл бұрын
same with me, my prof is always make anything dificult..
@desideriaionescu8693
@desideriaionescu8693 11 жыл бұрын
Hello! I stayed all day to read and understand this method, and nothing...then, I found your video and I have understood. It is the best explanation!! I will be happy if you will put the algorithm in C++, as soon as posible. Thank you a lot!!
@shrikantlondhe
@shrikantlondhe 11 жыл бұрын
Nice and quick explaination, thank you.
@kanakanakanakanameki2055
@kanakanakanakanameki2055 8 ай бұрын
wow I understand this very easily. thanks. the other explanations are too complicated and I don't have much time to study lol
@Nikhil88able
@Nikhil88able 8 жыл бұрын
u did a gr8 job!!... just took 8 mins and several questions of LCS SOlved...:)
@bryantwalley
@bryantwalley 9 жыл бұрын
This is good. Thanks for taking time to put it together.
@camaulay
@camaulay 10 жыл бұрын
Great! Very clean explanation. Thanks mate
@gopeswarnamasudra8895
@gopeswarnamasudra8895 7 жыл бұрын
please upload more videos on (dynamic and greedy) algorithms, You are a great teacher
@josephkatsioloudes9101
@josephkatsioloudes9101 7 жыл бұрын
Thank you so much for this explanation, my teacher was for the κάτσαρα!
@shivamkhandar5737
@shivamkhandar5737 2 жыл бұрын
Very easy and understanding method sir keep it on
@עומריפיינגולד
@עומריפיינגולד Жыл бұрын
listen man , this is the best shoki in thw world i understand everything but shir doesnt understand but now she will understand so slozki is the world have a good night
@sheriff2424
@sheriff2424 Жыл бұрын
Thanks bro you just saved my CAT tomorrow😇
@animexd6394
@animexd6394 3 жыл бұрын
Thanks man it's great explanation of the algorithm i read some blog about it but they always make stuff complicated for no reason.
@cheicktraore5062
@cheicktraore5062 8 ай бұрын
Ya vid help me a lot during my exam thank you so much 🙏🏿
@santoshjoshi7890
@santoshjoshi7890 8 жыл бұрын
thank alot,Daniel Sodkiewicz very simple to understand
@jackolaslock
@jackolaslock 10 жыл бұрын
Thanks for this video. I needed to see it being done to really get it.
@ShubhamGupta-dz5bn
@ShubhamGupta-dz5bn 10 жыл бұрын
Perfectly done!! Helped a lot!!
@dickyzuerst2828
@dickyzuerst2828 Жыл бұрын
thank you so much sir, finally i can understand it more better
@TheHappieCat
@TheHappieCat 8 жыл бұрын
This explains it so well!! Thank you!
@kouamelan87
@kouamelan87 11 жыл бұрын
nice you explained in a very simple manner. thanks
@ghostfacekillerist
@ghostfacekillerist 11 жыл бұрын
Thank you for your video! Helped me before a test!
@sohamc7402
@sohamc7402 8 жыл бұрын
Great work i wish you did more videos :)
@SmashedRadio
@SmashedRadio 8 жыл бұрын
You did well, sir. Very well. Thank you
@Thushan44
@Thushan44 10 жыл бұрын
Thanks mate! This is gonna help me a lot in my exam tomorrow lol
@hridoyth8866
@hridoyth8866 7 жыл бұрын
Thanks for such an awesome explanation
@rachitranjan
@rachitranjan 10 жыл бұрын
Thanks ..You made it super easy...
@supriyamekala8805
@supriyamekala8805 4 жыл бұрын
Superb Sir
@PriteshParekh77
@PriteshParekh77 10 жыл бұрын
Awesome explanation.Fount it very helpful. Thanks mate.
@faken143
@faken143 10 жыл бұрын
Nice tutorial! Than you Daniel.
@Pathorkuchimon
@Pathorkuchimon 8 жыл бұрын
if u go UP and LEFT its BCBA if u go LEFT and UP its BDAB 2 answers !
@zubairshahri2588
@zubairshahri2588 7 жыл бұрын
Tufayel Talha how to correct it then
@tomm7273
@tomm7273 7 жыл бұрын
The algorithm only gives you one of the longest subsequences. If there are multiple, taking different paths will give different subsequences. If you want all of them, you must traverse all paths.
@nguyenthanhdat93
@nguyenthanhdat93 6 жыл бұрын
I think It is okay to have two answers as long as the solution is optimal (one of the longest sequences).
@SnoozeDog
@SnoozeDog 5 жыл бұрын
good catch! There are only 2 answers if Left and Up are the same length and no diagonal exists on that entry. Since to get to that point you had to choose between 2 strings of equal length, thus both paths must be taken to derive answers
@hootis8
@hootis8 10 жыл бұрын
Great video, you explained everything very clearly, you saved my ass
@anesp.a913
@anesp.a913 10 жыл бұрын
Hi Dear Sir, A great work you have done , thanks alot Anes
@roboarif
@roboarif 10 жыл бұрын
Great work... I could not understand a thing when this was taught in class. But i understood perfectly here.. I m still confused why i could'nt get it in class :/
@OneShotLegacy360
@OneShotLegacy360 10 жыл бұрын
Thank you. Saved my life.
@i_dont_want_to_use_handle
@i_dont_want_to_use_handle 10 жыл бұрын
Thank you!!!!! 공부중에 LCS가 이해가 전혀 안 됐었는데, 덕분에 이해가 되었어요! 정말 감사합니다!!!
@kopiro
@kopiro 9 жыл бұрын
Great explanation. Thank you.
@rakeshraih
@rakeshraih 11 жыл бұрын
perfect, nicely done. you rock man
@tonyzhangable
@tonyzhangable 10 жыл бұрын
Thank you! Very clear explanation!
@HabiburRahmanHabibur
@HabiburRahmanHabibur 10 жыл бұрын
Thanks and good work but I think ,there are 2 LCS is possible from the table you created. so, If you show all the possible LCS ,it will be good .
@gianlucarosadini1163
@gianlucarosadini1163 3 жыл бұрын
Dude you are the best... Thank you!
@SRIHARSHAVARADA
@SRIHARSHAVARADA 11 жыл бұрын
nice..! Easy to understand..!
@piyushgoel3020
@piyushgoel3020 7 жыл бұрын
Simple explanation. Thanks
@dighechinmayt
@dighechinmayt 8 жыл бұрын
Thank you daniel.U made it easy
@senthilkumaran7936
@senthilkumaran7936 9 жыл бұрын
Thank you very much, that was very lucid.
@avibhav265254
@avibhav265254 9 жыл бұрын
thanks alot....kindly teach my teacher if u can.....
@richatiwari4043
@richatiwari4043 10 жыл бұрын
very nice explanation :)
@boyadeng7127
@boyadeng7127 9 жыл бұрын
It's a great illustration.
@tony-silver
@tony-silver 10 жыл бұрын
Nice explanation, thanks!
@sruthysathyanandan7268
@sruthysathyanandan7268 9 жыл бұрын
thanku sir....u taught well
@sakthivelpalanivelu3833
@sakthivelpalanivelu3833 10 жыл бұрын
Thank you so much. Very nice one.
@sundusali9293
@sundusali9293 7 жыл бұрын
very well explained. thank you
@InvitusCode
@InvitusCode 8 жыл бұрын
thanks for sharing, you saved my day! =)
@parasmalhotra7633
@parasmalhotra7633 6 жыл бұрын
nice and concise..
@Princebharti9971
@Princebharti9971 9 жыл бұрын
nice explanation !
@prajaktadeosthali3083
@prajaktadeosthali3083 8 жыл бұрын
Thanks a lot for this video!
@sumita913
@sumita913 10 жыл бұрын
Thanks so much! this totally helped me understand!
@mallikanaik14
@mallikanaik14 9 жыл бұрын
This was really helpful!! Thanks!!
@babanparab2370
@babanparab2370 7 жыл бұрын
thanks sir very nice explanation
@punstress
@punstress 10 жыл бұрын
So the subsequence doesn't have to match exactly, just be in order? One has BDAB but the other has BDCAB.
@DanielSodkiewicz
@DanielSodkiewicz 10 жыл бұрын
Yes, you are correct
@AdamAdam-yo3oh
@AdamAdam-yo3oh 7 жыл бұрын
Such a great tutorial.
@jenilgadani1491
@jenilgadani1491 8 жыл бұрын
helped a lot..thanks for uploading it :)
@pussio3950
@pussio3950 6 жыл бұрын
Simplicity at best, thanks
@swarajingle7639
@swarajingle7639 8 жыл бұрын
awesome vid 👍
@jmdryden
@jmdryden 10 жыл бұрын
thanks! super helpful.
@amitavital
@amitavital 7 жыл бұрын
Omg i love you its help me so much
@BrimozDDdDdD
@BrimozDDdDdD 11 жыл бұрын
very consise, much appreciated
@hayaaaa9273
@hayaaaa9273 6 жыл бұрын
Nicely taught
@itishreesahu8745
@itishreesahu8745 5 жыл бұрын
Thank u so much....👍👍
@ragulkumarrajendran4251
@ragulkumarrajendran4251 8 жыл бұрын
Nice one man
@1SSW
@1SSW 11 жыл бұрын
Hi there, are you able to do a video on Boyer Moore pattern matching algorithm with last occurrence table
@markmontejo1726
@markmontejo1726 9 жыл бұрын
thanks for this video sir :)
@hsuyusi8350
@hsuyusi8350 8 жыл бұрын
thank you, it's a great video !!
@SamraatMaharjan
@SamraatMaharjan 8 жыл бұрын
absolutely thanks bro
@doosc
@doosc 11 ай бұрын
Are the tracking results the same if I swap rows and columns?
@shubhamupadhyay4695
@shubhamupadhyay4695 8 жыл бұрын
thanks a ton man..This helped alot.
@lucumu
@lucumu 5 ай бұрын
another awser is BCBA,Which one should we choose?
@Melaf90s
@Melaf90s 2 жыл бұрын
Think you so much
@maphioso
@maphioso 8 жыл бұрын
thank you so much !
@semirek
@semirek 10 жыл бұрын
Thanks a lot!
@shocolate0104
@shocolate0104 10 жыл бұрын
Thanks! found it helpful!
@LUX1111111111111
@LUX1111111111111 9 жыл бұрын
just curious did u film it with ur cellphone
@DanielSodkiewicz
@DanielSodkiewicz 9 жыл бұрын
LUX1111111111111 indeed :)
@guywithspectacles
@guywithspectacles 5 жыл бұрын
THANK YOU SO MUCH MAN YOU ARE LOVE YOU ARE LIFE... COZ U JUST SAVED MY ASSS FROM FAILING XD
@md.shafaatjamilrokon8587
@md.shafaatjamilrokon8587 6 жыл бұрын
thnks.lve frm Bangladesh
@horsefeather
@horsefeather 9 жыл бұрын
Why does the LCS of ABCB not work as well? I also noticed that you found this exercise in the Introduction to Algorithms textbook which I am currently using for my course.
@DanielSodkiewicz
@DanielSodkiewicz 9 жыл бұрын
yes, there are few correrct solutions
@PaTTaMoNE
@PaTTaMoNE 11 жыл бұрын
Thank you for your video. I am very grateful. You have helped a lot. :D
@dhhsncnd6107
@dhhsncnd6107 10 жыл бұрын
The logic is simple here, let LCS [i,j] represent longest common substring of a[1...i] and b[1..j]. if (a[i] == b[j]) LCS[i,j] = LCS[i-1,j-1] + 1; else LCS[i,j] = max(LCS[i-1,j], LCS[i,j-1]);
@donovankeating8577
@donovankeating8577 7 жыл бұрын
Why do we have to get the max of L[i-1][j] and L[i][j-1] if no commonality is found? Is it because of the 0's in the first row and column? Because for other cases, the max is always the cell to the left. Am I right?
@sakuray7
@sakuray7 9 жыл бұрын
Thanks!!!
@tartacalin7732
@tartacalin7732 10 жыл бұрын
Thank you.
@gioduduchadze2430
@gioduduchadze2430 10 жыл бұрын
couldn't we go from ones to zeroes on CB? there was a bridge over there or if there's a chance to go left or top we should use it always?
@DanielSodkiewicz
@DanielSodkiewicz 10 жыл бұрын
When you start in the corner, you decide if you will follow a pattern left top , or top left and you follow that for the entire journey, To answer your question: if you can go left or top - yes, you must go this direction.
@MdSazzadulIslamsazib
@MdSazzadulIslamsazib 10 жыл бұрын
Nice one :)
@kshitizadhikari3855
@kshitizadhikari3855 9 жыл бұрын
awesome !!thnks :)
@theess1248
@theess1248 10 жыл бұрын
Thank you
@Beesh29
@Beesh29 8 жыл бұрын
thanks 🌷
@SaurabhGupta-bl5bb
@SaurabhGupta-bl5bb 8 жыл бұрын
Nailed it !
Diff Algorithm Explained | The texts comparison algorithm
14:25
Men Vs Women Survive The Wilderness For $500,000
31:48
MrBeast
Рет қаралды 99 МЛН
Modus males sekolah
00:14
fitrop
Рет қаралды 25 МЛН
Angry Sigma Dog 🤣🤣 Aayush #momson #memes #funny #comedy
00:16
ASquare Crew
Рет қаралды 50 МЛН
Поветкин заставил себя уважать!
01:00
МИНУС БАЛЛ
Рет қаралды 4,9 МЛН
Longest Increasing Subsequence
7:09
Tushar Roy - Coding Made Simple
Рет қаралды 439 М.
Longest Common Subsequence
7:55
Tushar Roy - Coding Made Simple
Рет қаралды 762 М.
Longest Common Subsequence | Dynamic Programming
5:59
Quoc Dat Phung
Рет қаралды 998
SHA: Secure Hashing Algorithm - Computerphile
10:21
Computerphile
Рет қаралды 1,2 МЛН
Short trick to solve longest common subsequence(LCS)
8:26
All technical solution
Рет қаралды 155 М.
Longest Common Subsequence- Dynamic Programming | Data structures and algorithms
25:47
The 0/1 Knapsack Problem - Dynamic Programming Method
10:45
19  Longest common subsequence Recursive
27:42
Aditya Verma
Рет қаралды 288 М.
Men Vs Women Survive The Wilderness For $500,000
31:48
MrBeast
Рет қаралды 99 МЛН