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
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!!
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 :)
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.
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
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 :/
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]);
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.
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?
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.
Great explanation. My prof didn't teach it this way, but makes the dynamic programming solution so much clearer!
8 years later and his solution is better than my prof😂
@@AbdulwahabSWE same 😂
you should make more algorithm videos. you're really good at explaining.
Yes we need more
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
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!!
wow I understand this very easily. thanks. the other explanations are too complicated and I don't have much time to study lol
Thank you so much! I want to see more algorithm videos from you as you're really good at explaining them!
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 :)
u did a gr8 job!!... just took 8 mins and several questions of LCS SOlved...:)
Thanks bro you just saved my CAT tomorrow😇
Wonderful explanation! You are a great teacher!!!
Thanks man it's great explanation of the algorithm i read some blog about it but they always make stuff complicated for no reason.
Great! Very clean explanation. Thanks mate
thank alot,Daniel Sodkiewicz very simple to understand
This is good. Thanks for taking time to put it together.
please upload more videos on (dynamic and greedy) algorithms, You are a great teacher
Thanks for this video. I needed to see it being done to really get it.
can you teach this to my teacher too??
damn she made this so difficult to understand!
Dhanyawad(Thank You)!
My teacher is the same !
Yo fckin same here...i hate my teacher
same with me, my prof is always make anything dificult..
Thank you so much for this explanation, my teacher was for the κάτσαρα!
Ya vid help me a lot during my exam thank you so much 🙏🏿
Very easy and understanding method sir keep it on
if u go UP and LEFT its BCBA
if u go LEFT and UP its BDAB
2 answers !
Tufayel Talha how to correct it then
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.
I think It is okay to have two answers as long as the solution is optimal (one of the longest sequences).
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
Perfectly done!! Helped a lot!!
Thanks mate! This is gonna help me a lot in my exam tomorrow lol
perfect, nicely done. you rock man
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 :/
Thank you!!!!!
공부중에 LCS가 이해가 전혀 안 됐었는데, 덕분에 이해가 되었어요! 정말 감사합니다!!!
thank you so much sir, finally i can understand it more better
Awesome explanation.Fount it very helpful.
Thanks mate.
Thank you for your video! Helped me before a test!
Thank you. Saved my life.
You did well, sir. Very well. Thank you
Nice and quick explaination, thank you.
Great work i wish you did more videos :)
This explains it so well!! Thank you!
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 .
Thanks for such an awesome explanation
Great video, you explained everything very clearly, you saved my ass
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]);
Nice tutorial! Than you Daniel.
Dude you are the best... Thank you!
nice you explained in a very simple manner. thanks
Simple explanation. Thanks
Thank you very much, that was very lucid.
Great explanation. Thank you.
Hi Dear Sir,
A great work you have done , thanks alot
Anes
So the subsequence doesn't have to match exactly, just be in order? One has BDAB but the other has BDCAB.
Yes, you are correct
Thank you! Very clear explanation!
Nice explanation, thanks!
Thanks a lot for this video!
Superb Sir
Are the tracking results the same if I swap rows and columns?
very well explained. thank you
Thanks ..You made it super easy...
Thank you so much. Very nice one.
Thank you daniel.U made it easy
7:35 u went to top twice didn't follow top left sequence
another awser is BCBA,Which one should we choose?
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.
yes, there are few correrct solutions
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?
This was really helpful!! Thanks!!
Hi there, are you able to do a video on Boyer Moore pattern matching algorithm with last occurrence table
nice..!
Easy to understand..!
Thanks so much! this totally helped me understand!
Such a great tutorial.
It's a great illustration.
helped a lot..thanks for uploading it :)
thanks for sharing, you saved my day! =)
thanks a ton man..This helped alot.
thanks! super helpful.
nice and concise..
very nice explanation :)
just curious did u film it with ur cellphone
LUX1111111111111 indeed :)
nice explanation !
thanku sir....u taught well
Thanks! found it helpful!
thanks sir very nice explanation
Nicely taught
thank you, it's a great video !!
very consise, much appreciated
awesome vid 👍
THANK YOU SO MUCH MAN YOU ARE LOVE YOU ARE LIFE... COZ U JUST SAVED MY ASSS FROM FAILING XD
absolutely thanks bro
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?
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.
thanks alot....kindly teach my teacher if u can.....
Omg i love you
its help me so much
perfectly tailored till required
How is that the LCS? BDCABA doesn't contain BDAB... am I missing something?
+Daniel Levi it is not necessary for lcs that letters or pattern should be consecutive it should be continuous for e.g., here BDcABa contains BDAB
Nice one man
Thanks a lot!
thanks for this video sir :)
thank you so much !
but how is BDAB a subsequence of BDCABA?
Thank u so much....👍👍
Thank you for your video. I am very grateful.
You have helped a lot. :D
Think you so much
Thanks!!!
I found another two results.
Result 1 is: B,C,B,A
Result 2 is: B,C,A,B
Result 3 is(your result): B,D,A,B
I found the BCBA. Can there be multiple correct answers in LCS?
@@doosc I guess yes
thnks.lve frm Bangladesh
AWESOME!!!!!!!
Nailed it !