Longest common subsequence algorithm -- example

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии •

  • @4blossoms
    @4blossoms 10 лет назад +8

    Great explanation. My prof didn't teach it this way, but makes the dynamic programming solution so much clearer!

    • @AbdulwahabSWE
      @AbdulwahabSWE Год назад +2

      8 years later and his solution is better than my prof😂

    • @techvishnuyt
      @techvishnuyt Год назад +1

      @@AbdulwahabSWE same 😂

  • @bigray712
    @bigray712 8 лет назад +16

    you should make more algorithm videos. you're really good at explaining.

  • @עומריפיינגולד
    @עומריפיינגולד Год назад +1

    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

  • @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!!

  • @kanakanakanakanameki2055
    @kanakanakanakanameki2055 10 месяцев назад +1

    wow I understand this very easily. thanks. the other explanations are too complicated and I don't have much time to study lol

  • @shanekhantsoemoe4996
    @shanekhantsoemoe4996 6 лет назад +2

    Thank you so much! I want to see more algorithm videos from you as you're really good at explaining them!

  • @princemaratas3531
    @princemaratas3531 7 лет назад +2

    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 :)

  • @Nikhil88able
    @Nikhil88able 9 лет назад

    u did a gr8 job!!... just took 8 mins and several questions of LCS SOlved...:)

  • @jalupo
    @jalupo Год назад

    Thanks bro you just saved my CAT tomorrow😇

  • @pchebbi
    @pchebbi 7 лет назад +3

    Wonderful explanation! You are a great teacher!!!

  • @animexd6394
    @animexd6394 4 года назад

    Thanks man it's great explanation of the algorithm i read some blog about it but they always make stuff complicated for no reason.

  • @camaulay
    @camaulay 10 лет назад +1

    Great! Very clean explanation. Thanks mate

  • @santoshjoshi7890
    @santoshjoshi7890 8 лет назад

    thank alot,Daniel Sodkiewicz very simple to understand

  • @bryantwalley
    @bryantwalley 10 лет назад +1

    This is good. Thanks for taking time to put it together.

  • @gopeswarnamasudra8895
    @gopeswarnamasudra8895 7 лет назад +1

    please upload more videos on (dynamic and greedy) algorithms, You are a great teacher

  • @jackolaslock
    @jackolaslock 10 лет назад

    Thanks for this video. I needed to see it being done to really get it.

  • @ChiranjeevTapas
    @ChiranjeevTapas 10 лет назад +28

    can you teach this to my teacher too??
    damn she made this so difficult to understand!
    Dhanyawad(Thank You)!

  • @josephkatsioloudes9101
    @josephkatsioloudes9101 7 лет назад +2

    Thank you so much for this explanation, my teacher was for the κάτσαρα!

  • @cheicktraore5062
    @cheicktraore5062 10 месяцев назад

    Ya vid help me a lot during my exam thank you so much 🙏🏿

  • @shivamkhandar5737
    @shivamkhandar5737 2 года назад

    Very easy and understanding method sir keep it on

  • @Pathorkuchimon
    @Pathorkuchimon 8 лет назад +10

    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 лет назад +1

      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

  • @ShubhamGupta-dz5bn
    @ShubhamGupta-dz5bn 10 лет назад +1

    Perfectly done!! Helped a lot!!

  • @Thushan44
    @Thushan44 10 лет назад

    Thanks mate! This is gonna help me a lot in my exam tomorrow lol

  • @rakeshraih
    @rakeshraih 11 лет назад

    perfect, nicely done. you rock man

  • @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 :/

  • @i_dont_want_to_use_handle
    @i_dont_want_to_use_handle 11 лет назад

    Thank you!!!!!
    공부중에 LCS가 이해가 전혀 안 됐었는데, 덕분에 이해가 되었어요! 정말 감사합니다!!!

  • @dickyzuerst2828
    @dickyzuerst2828 Год назад

    thank you so much sir, finally i can understand it more better

  • @PriteshParekh77
    @PriteshParekh77 11 лет назад

    Awesome explanation.Fount it very helpful.
    Thanks mate.

  • @ghostfacekillerist
    @ghostfacekillerist 11 лет назад

    Thank you for your video! Helped me before a test!

  • @OneShotLegacy360
    @OneShotLegacy360 10 лет назад

    Thank you. Saved my life.

  • @SmashedRadio
    @SmashedRadio 9 лет назад

    You did well, sir. Very well. Thank you

  • @shrikantlondhe
    @shrikantlondhe 11 лет назад

    Nice and quick explaination, thank you.

  • @sohamc7402
    @sohamc7402 9 лет назад +1

    Great work i wish you did more videos :)

  • @TheHappieCat
    @TheHappieCat 8 лет назад +1

    This explains it so well!! Thank you!

  • @HabiburRahmanHabibur
    @HabiburRahmanHabibur 10 лет назад +3

    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 .

  • @hridoyth8866
    @hridoyth8866 7 лет назад

    Thanks for such an awesome explanation

  • @hootis8
    @hootis8 10 лет назад

    Great video, you explained everything very clearly, you saved my ass

  • @dhhsncnd6107
    @dhhsncnd6107 11 лет назад +2

    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]);

  • @faken143
    @faken143 11 лет назад

    Nice tutorial! Than you Daniel.

  • @gianlucarosadini1163
    @gianlucarosadini1163 3 года назад

    Dude you are the best... Thank you!

  • @kouamelan87
    @kouamelan87 11 лет назад

    nice you explained in a very simple manner. thanks

  • @piyushgoel3020
    @piyushgoel3020 8 лет назад

    Simple explanation. Thanks

  • @senthilkumaran7936
    @senthilkumaran7936 9 лет назад

    Thank you very much, that was very lucid.

  • @kopiro
    @kopiro 9 лет назад

    Great explanation. Thank you.

  • @anesp.a913
    @anesp.a913 10 лет назад

    Hi Dear Sir,
    A great work you have done , thanks alot
    Anes

  • @punstress
    @punstress 11 лет назад +2

    So the subsequence doesn't have to match exactly, just be in order? One has BDAB but the other has BDCAB.

  • @tonyzhangable
    @tonyzhangable 10 лет назад

    Thank you! Very clear explanation!

  • @ShroomsUnited
    @ShroomsUnited 11 лет назад

    Nice explanation, thanks!

  • @prajaktadeosthali3083
    @prajaktadeosthali3083 9 лет назад

    Thanks a lot for this video!

  • @supriyamekala8805
    @supriyamekala8805 4 года назад

    Superb Sir

  • @doosc
    @doosc Год назад

    Are the tracking results the same if I swap rows and columns?

  • @sundusali9293
    @sundusali9293 8 лет назад

    very well explained. thank you

  • @rachitranjan
    @rachitranjan 11 лет назад +1

    Thanks ..You made it super easy...

  • @sakthivelpalanivelu3833
    @sakthivelpalanivelu3833 10 лет назад

    Thank you so much. Very nice one.

  • @dighechinmayt
    @dighechinmayt 9 лет назад

    Thank you daniel.U made it easy

  • @be_55_atharvsankpal38
    @be_55_atharvsankpal38 4 года назад +1

    7:35 u went to top twice didn't follow top left sequence

  • @lucumu
    @lucumu 7 месяцев назад

    another awser is BCBA,Which one should we choose?

  • @horsefeather
    @horsefeather 10 лет назад

    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.

  • @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?

  • @mallikanaik14
    @mallikanaik14 9 лет назад

    This was really helpful!! Thanks!!

  • @1SSW
    @1SSW 11 лет назад

    Hi there, are you able to do a video on Boyer Moore pattern matching algorithm with last occurrence table

  • @SRIHARSHAVARADA
    @SRIHARSHAVARADA 11 лет назад

    nice..!
    Easy to understand..!

  • @sumita913
    @sumita913 10 лет назад

    Thanks so much! this totally helped me understand!

  • @AdamAdam-yo3oh
    @AdamAdam-yo3oh 7 лет назад

    Such a great tutorial.

  • @boyadeng7127
    @boyadeng7127 9 лет назад

    It's a great illustration.

  • @jenilgadani1491
    @jenilgadani1491 8 лет назад

    helped a lot..thanks for uploading it :)

  • @InvitusCode
    @InvitusCode 8 лет назад +1

    thanks for sharing, you saved my day! =)

  • @shubhamupadhyay4695
    @shubhamupadhyay4695 9 лет назад

    thanks a ton man..This helped alot.

  • @jmdryden
    @jmdryden 10 лет назад

    thanks! super helpful.

  • @parasmalhotra7633
    @parasmalhotra7633 6 лет назад

    nice and concise..

  • @richatiwari4043
    @richatiwari4043 10 лет назад

    very nice explanation :)

  • @LUX1111111111111
    @LUX1111111111111 9 лет назад +1

    just curious did u film it with ur cellphone

  • @Princebharti9971
    @Princebharti9971 10 лет назад

    nice explanation !

  • @sruthysathyanandan7268
    @sruthysathyanandan7268 9 лет назад

    thanku sir....u taught well

  • @shocolate0104
    @shocolate0104 10 лет назад

    Thanks! found it helpful!

  • @babanparab2370
    @babanparab2370 7 лет назад

    thanks sir very nice explanation

  • @hayaaaa9273
    @hayaaaa9273 6 лет назад

    Nicely taught

  • @hsuyusi8350
    @hsuyusi8350 8 лет назад

    thank you, it's a great video !!

  • @BrimozDDdDdD
    @BrimozDDdDdD 11 лет назад

    very consise, much appreciated

  • @swarajingle7639
    @swarajingle7639 8 лет назад

    awesome vid 👍

  • @guywithspectacles
    @guywithspectacles 5 лет назад

    THANK YOU SO MUCH MAN YOU ARE LOVE YOU ARE LIFE... COZ U JUST SAVED MY ASSS FROM FAILING XD

  • @SamraatMaharjan
    @SamraatMaharjan 8 лет назад

    absolutely thanks bro

  • @gioduduchadze2430
    @gioduduchadze2430 11 лет назад

    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  11 лет назад +1

      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.

  • @avibhav265254
    @avibhav265254 10 лет назад

    thanks alot....kindly teach my teacher if u can.....

  • @amitavital
    @amitavital 7 лет назад

    Omg i love you
    its help me so much

  • @yasaswinichanda4257
    @yasaswinichanda4257 9 лет назад +1

    perfectly tailored till required

  • @daniellevi396
    @daniellevi396 9 лет назад

    How is that the LCS? BDCABA doesn't contain BDAB... am I missing something?

    • @lightion7746
      @lightion7746 8 лет назад +1

      +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

  • @ragulkumarrajendran4251
    @ragulkumarrajendran4251 9 лет назад

    Nice one man

  • @semirek
    @semirek 11 лет назад

    Thanks a lot!

  • @markmontejo1726
    @markmontejo1726 9 лет назад

    thanks for this video sir :)

  • @maphioso
    @maphioso 8 лет назад

    thank you so much !

  • @qu3ntin
    @qu3ntin 7 месяцев назад

    but how is BDAB a subsequence of BDCABA?

  • @itishreesahu8745
    @itishreesahu8745 5 лет назад

    Thank u so much....👍👍

  • @PaTTaMoNE
    @PaTTaMoNE 11 лет назад

    Thank you for your video. I am very grateful.
    You have helped a lot. :D

  • @Melaf90s
    @Melaf90s 2 года назад

    Think you so much

  • @sakuray7
    @sakuray7 9 лет назад

    Thanks!!!

  • @melihekizce2318
    @melihekizce2318 Год назад +1

    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

    • @doosc
      @doosc Год назад

      I found the BCBA. Can there be multiple correct answers in LCS?

    • @melihekizce2318
      @melihekizce2318 Год назад

      @@doosc I guess yes

  • @md.shafaatjamilrokon8587
    @md.shafaatjamilrokon8587 6 лет назад

    thnks.lve frm Bangladesh

  • @hasimkeskin8521
    @hasimkeskin8521 Год назад

    AWESOME!!!!!!!

  • @SaurabhGupta-bl5bb
    @SaurabhGupta-bl5bb 8 лет назад

    Nailed it !