Longest Common Subsequence

Поділитися
Вставка
  • Опубліковано 7 бер 2015
  • Given two strings, find longest common subsequence between them.
    github.com/mission-peace/inte...
    github.com/mission-peace/inte...

КОМЕНТАРІ • 550

  • @chenjus
    @chenjus 3 роки тому +74

    This is the clearest, complete, and most concise explanation of longest common subseq I've seen so far. Thank you so much!

  • @ketan4221
    @ketan4221 6 років тому +111

    Tushar's favorite line - `Yes, we will use dynamic programming to solve this ;)`

    • @shashanksagarjha2807
      @shashanksagarjha2807 3 роки тому

      please check this playlist : ua-cam.com/play/PLeF0b8iqbx4mogykbd82-HY9Y1-JS9MDr.html

    • @kurchak
      @kurchak 3 роки тому +5

      haha I always loved that too.

    • @amanrubey
      @amanrubey Рік тому

      😂😂😂❤

  • @niqbal81
    @niqbal81 7 років тому +5

    Love, how knowledgeable and clear as a teacher you are. Absolutely in debt. Much respect

  • @GameKeppers
    @GameKeppers 8 років тому +107

    reading wikipedia for ages...
    finnaly with your video i do understand the sequence so thank you very much:)
    greetings from Germany:)

    • @RagazzoKZ
      @RagazzoKZ 5 років тому

      GameKeppers haha, same situation

    • @shashanksagarjha2807
      @shashanksagarjha2807 3 роки тому

      please check this playlist : ua-cam.com/play/PLeF0b8iqbx4mogykbd82-HY9Y1-JS9MDr.html

  • @anshusharma11
    @anshusharma11 8 років тому +2

    All your videos are just awesome. You explain every detail so clearly . I like that you don't rush the things.

  • @NehaJain1704
    @NehaJain1704 9 років тому +35

    Nothing on the net has made DP more easier..thanks a ton!! :)

  • @amanrubey
    @amanrubey Рік тому +7

    The best part about his lectures are that the way he demonstrates things makes our brain automatically figure out why we are doing this and this is what no other channel on UA-cam provides.
    I'm really thankful to Tushar for making iterative dp my second nature 🙏🏼❤

  • @nathant6010
    @nathant6010 3 роки тому +1

    Thank you Tushar. I am sure that no one have explained Dynamic Programming this simple and straightforward. Even we may not be able understand how the values are filled in the DP array dynamically in other explanations. Most of them are always very simple Fibonacci example or very high level. So, for anyone who would like to understand Dynamic Programming, your videos are the best.

  • @malinisai5297
    @malinisai5297 8 років тому +21

    I learned most of the stuff from your videos, sir. It's quite helpful.Thank you so much.

  • @thesoftwareman
    @thesoftwareman Рік тому +2

    I still come back to this video years later after tripling my SWE salary, priceless content

  • @aryankhare9393
    @aryankhare9393 4 роки тому

    Your way of teaching makes me visualise things and I really want to thank you for this.

  • @GoldenSpud
    @GoldenSpud 6 років тому

    You are an absolute champion, your answer and explanation was really clear great job.

  • @camccorm
    @camccorm 7 років тому +4

    Thank you so much for this video, you explained it very well! Much appreciated!

  • @satishchandra6623
    @satishchandra6623 3 роки тому +1

    The video that started my interest in dynamic programming. Seen this video 4 years ago in 2017 for the first time and with one example I got the whole idea about Dynamic programming. After that I'm able to solve most of the coding problems using Dynamic Programming approach.

  • @yanzheng2147
    @yanzheng2147 4 роки тому

    Supper clear! After watching your explanation, I am able to finish the code within 5 min! Thank you!

  • @vikramadityakukreja4795
    @vikramadityakukreja4795 8 років тому +7

    Nicely explained and easy to understand . Thanks a lot!

  • @dakshjay
    @dakshjay Рік тому

    Just wanted to revisit Tushar's videos after completing my employment of 4 years at Google in the Bay Area. big thanks to you Tushar to help me with this and other challenging problems!

  • @shingo9302
    @shingo9302 5 років тому +3

    Feels so good to finally understand this, thank you!

  • @rma1563
    @rma1563 Місяць тому

    took only 8 minutes to explain what most take 20+ minutes. And you did it great. cleared up everything. Thanks

  • @jayeshkawli
    @jayeshkawli 4 роки тому

    Amazing video. Would have taken me an entire day had I gone through online sources. This cleared all the things in less than 10 minutes. Thank you so much!!

  • @deansonnier1167
    @deansonnier1167 5 років тому +1

    What a fantastic lesson! Thank you, Tushar.

  • @deepakbisht7764
    @deepakbisht7764 7 років тому +16

    THKS man you just save my Semester

  • @T1Oracle
    @T1Oracle 6 років тому +1

    Learning how to use a matrix to solve these kinds of questions was a real break through for me. That visualization is better than seeing code, now I can write it any language easily.

  • @Aldrasio
    @Aldrasio 6 років тому

    Great explanation, this makes dynamic programming much easier to understand.

  • @yvestuyishime5209
    @yvestuyishime5209 6 років тому

    well, i don't know how i could pass quizzes without your videos :( I've been using your videos for most of algorithms and they are ease to understand and not time consuming compared to the time i could spend reading the book and sometime don't even understand the pseudo-code itself. THANK YOU, THANK YOU AND THANK YOU ONCE MORE.

  • @ericren4909
    @ericren4909 8 років тому +2

    Thanks I'm making progress on my interview skills. Awesome tutorials.

  • @66saly
    @66saly 7 років тому +2

    Perfect tutorial! You deserve hundred of likes for saving my time 👍🏼

  • @minhthinhhuynhle9103
    @minhthinhhuynhle9103 2 роки тому

    You are the best lecturer I currently found on UA-cam to teach hard problem using Advance Technique. No one else can eplain in short, precise & natural as you Tushar !!!
    > This will always be your punchline "The best we can do WITHOUT". And it's damn easy to understand in Natural Language rather than cold codes.

  • @hutfling7178
    @hutfling7178 8 років тому +3

    The short lesson make me cleat about LCS problem,Thanks!

  • @1234padrino
    @1234padrino 6 років тому +12

    I wonder how my teachers can explain such simple algorithms in a way that noone understands it. I learned all algorithms from indian students. Thx, I love you man

  • @guieguima
    @guieguima 5 років тому

    Thank you once again for the explanation! You really are a life-saver!

  • @khalednaami2
    @khalednaami2 6 років тому

    After searching LCS a lot on the web, finally I found an easy explanation. Thanks a lot.

  • @amaryllis.custtt
    @amaryllis.custtt 8 років тому +5

    thanx a lot ,simple and effective ,make the problem easy

  • @jaideepbommidi8611
    @jaideepbommidi8611 8 років тому

    thank you very much I was able to understand everything.
    i was able to see how the already computed values were used for the calculation avoiding the redundancy, which is clearly a dynamic programming concept.
    thank you for such a wonderful video. Hope you help us more.

  • @0diepus
    @0diepus 7 років тому

    Holy mollie! I finally got it!!!! Thanks for the time you put into this.

  • @prashantganeshsamudrala626
    @prashantganeshsamudrala626 4 роки тому

    One of the Best explanations I have heard so far in coding

  • @hrishikeshwaikar251
    @hrishikeshwaikar251 8 років тому

    Very well explained . Thanks for simplicity!

  • @johnbrown903
    @johnbrown903 5 років тому

    ive learned alot from your vids of dynamic programming. Thanks man

  • @nikkis8102
    @nikkis8102 7 місяців тому +1

    I'm here 8 years later! I need him to go through all the Leetcode 75! 😃

  • @ameychavan70
    @ameychavan70 Рік тому +1

    One of the best explanations I ever saw on this topic !!.... Thank you very much sir 😀 👏🏻👏🏻

  • @manantank
    @manantank 6 років тому +1

    i have passed the algorithm subject just by watching your videos... thanks a lot !!

  • @alifhasnain3200
    @alifhasnain3200 5 років тому

    You make every topic very easy to understand. Thanks. :)

  • @suryamp12
    @suryamp12 8 років тому

    Dude, I really like your videos. Super helpful during prep. I hope you're having fun at your workplace but you should consider doing this fulltime ;)

  • @AgentAileron
    @AgentAileron 5 років тому

    Concise and well explained, didn't really understand this algo too well in DP
    Cheers!

  • @thisiscelxius
    @thisiscelxius 7 років тому

    This was incredibly helpful! Thank you so much.

  • @aditijain515
    @aditijain515 9 років тому +18

    You have explained all DP problems very well...thanks a ton :)

  • @ashdavv
    @ashdavv 7 років тому

    Superb explanation .. If i am stuck in any problem then instead of google just finding your solution for the problem is the best thing.. Thanks ..

  • @aggreym.muhebwa7077
    @aggreym.muhebwa7077 6 років тому

    +1 for explaining DP in such an easy way. Thanks alot

  • @ruthsalinas2613
    @ruthsalinas2613 8 років тому

    THANK YOU! You saved me! No one on the net has ever explained DP well but you. Keep it up :)

  • @MagigeChacha
    @MagigeChacha 4 роки тому

    This is the best explanation for LCS problem so far. You are great bro.

  • @harinijeyaraman8789
    @harinijeyaraman8789 4 роки тому

    Love your videos Tushar ! Thanks ! really appreciate your efforts

  • @sureshchowta
    @sureshchowta 7 років тому

    Thank you for these videos on Dynamic Programming...

  • @varunkumar3594
    @varunkumar3594 8 років тому

    These videos are enjoyable, you rock man

  • @robertsun5529
    @robertsun5529 8 років тому

    Very clear little tutorial! Nice job and thanks!!

  • @MarvinsRoom_
    @MarvinsRoom_ 4 роки тому +1

    Good tutorial. Very articulate and clear 🙏

  • @ashishgadre
    @ashishgadre 7 років тому +5

    I think there needs to be more explanation on why there is a max used when the last char don't match. The reason is explained very well in the following section of the wiki page:
    en.wikipedia.org/wiki/Longest_common_subsequence_problem#Second_property
    Suppose that the two sequences X and Y do not end in the same symbol. Then the LCS of X and Y is the longer of the two sequences LCS(Xn,Ym-1) and LCS(Xn-1,Ym).
    To understand this property, consider the two following sequences :
    sequence X: ABCDEFG (n elements)
    sequence Y: BCDGK (m elements)
    The LCS of these two sequences either ends with a G (the last element of sequence X) or does not.
    Case 1: the LCS ends with a G
    Then it cannot end with a K. Thus it does not hurt to remove the K from sequence Y: if K were in the LCS, it would be its last character; as a consequence K is not in the LCS. We can then write: LCS(Xn,Ym) = LCS(Xn, Ym-1).
    Case 2: the LCS does not end with a G
    Then it does not hurt to remove the G from the sequence X (for the same reason as above). And then we can write: LCS(Xn,Ym) = LCS(Xn-1, Ym).
    In any case, the LCS we are looking for is one of LCS(Xn, Ym-1) or LCS(Xn-1, Ym). Those two last LCS are both common subsequences to X and Y. LCS(X,Y) is the longest. Thus its value is the longest sequence of LCS(Xn, Ym-1) and LCS(Xn-1, Ym).

  • @poojahembrom4229
    @poojahembrom4229 6 років тому

    This was so easy to learn. Thanks a ton! ❤

  • @prateekyadav1109
    @prateekyadav1109 8 років тому

    your videos are really helpful and you are doing a noble job.

  • @RafaelNascimento-qo1jp
    @RafaelNascimento-qo1jp 2 роки тому

    BEST explanation on this topic so far!

  • @ParagAwadhiya
    @ParagAwadhiya 6 років тому

    Thanks Tushar, you've made it so simple to understand.

  • @gauravkumarsingh3234
    @gauravkumarsingh3234 7 років тому

    I must say your videos are very helpful... I consider only your videos for my Data structure and algorithms exams preparation..

  • @deepTh00ught
    @deepTh00ught 3 роки тому +1

    Tushar you are such a good human, thank you a lot

  • @dailydestress6189
    @dailydestress6189 2 роки тому

    Explained so simply. Thanks a lot.

  • @Neithan
    @Neithan 8 років тому

    This is the best reference! :) Thank you very much.

  • @gaiusjuliuscaesar9296
    @gaiusjuliuscaesar9296 2 роки тому

    Great explanation of the process, thanks!

  • @synycboom
    @synycboom 8 років тому +1

    Thank you guy. I've just understood how to solve this problem from you :)

  • @accelator007
    @accelator007 3 роки тому

    By far the best video on this topic.

  • @pdppradeep
    @pdppradeep 7 років тому

    You made it look some simple tushar!, you are a great teacher., thanks.

  • @jesusantoniososaherrera2217
    @jesusantoniososaherrera2217 8 років тому

    Very clear and easy to understand.
    Cheers !!!

  • @noelsoans1835
    @noelsoans1835 4 роки тому +1

    Thank you so much!!! It really clears the concept!!!!

  • @aashishrulz
    @aashishrulz 8 років тому

    thanks alot for the videos, helps me alot to understand Dp and Network flow.
    thanks again

  • @Firecloak
    @Firecloak 3 роки тому

    clear, short explanation. Thank you so much!

  • @itsbinhphan
    @itsbinhphan 4 роки тому

    Thank you!! This was so clear and concise :)

  • @satang500
    @satang500 9 років тому +2

    I've been looking at lots of lecture notes, tutorials and videos in the Internet to understand DP, but couldn't clearly understand until I watched your video. Your approach of DP is the best I've ever seen and now I'm confident in DP. :)

  • @shivamrohilla9379
    @shivamrohilla9379 6 років тому

    thanks a lot bro
    keep making these types videos
    very helpful in clearing concepts

  • @shanta32220
    @shanta32220 7 років тому

    thank you so much! I wanted to solve a problem related to this but even seeing the solutions i had no idea what they were doing until i saw your explanation!. will make sure to check more videos of yours. ^_^

  • @BrianOndieki9
    @BrianOndieki9 9 років тому

    Thank you, you really make DP very easy to understand

  • @rudolferemyan8133
    @rudolferemyan8133 8 років тому +157

    Thnx a lot... it's so easy to understand and implement and not try to memorize a code When you have Cool teacher like you)) One more time THNX))

    • @akshaychatterjee3328
      @akshaychatterjee3328 7 років тому +19

      do u memorize code generally?

    • @cantwaittowatch
      @cantwaittowatch 7 років тому +2

      its our great teachers in colleges who passed this wealth of memorization knowledge with out giving an explanation like this which makes algorithms difficult to learn. I'm not surprised to hear these comments. I'm glad Tushar is doing such a wonderful job here. Kudos to him!!

    • @avinashtripathi4159
      @avinashtripathi4159 7 років тому

      Rudolf Eremyan is this algorithm o(n)?

    • @miltonkumar3655
      @miltonkumar3655 6 років тому

      O(nm)

    • @avinashtripathi4159
      @avinashtripathi4159 6 років тому

      MILTON KUMAR exactly! And that is not linear time

  • @OdiyaS
    @OdiyaS 8 років тому +1

    great video! saved me hours of trying to understand the slideshow from class!

  • @partha95123
    @partha95123 7 років тому

    Very good tutorials. Thanks a lot Tushar for the video.

  • @PeculiarPI
    @PeculiarPI 6 років тому

    Thanks!! You have made a really nice tutorial.

  • @gyrfalcon23
    @gyrfalcon23 8 років тому

    Great, clear lesson! Thank you!

  • @ralphhouthoofdt3505
    @ralphhouthoofdt3505 7 років тому

    Thanks alot for this excellent walkthrough.

  • @cook9256
    @cook9256 6 років тому

    It is so clear now after watched this video. Thanks!!

  • @irynasherepot9882
    @irynasherepot9882 4 роки тому

    Thank you Tushar, your tutorial are great and helped me a lot!

  • @aiswaryarajendran2301
    @aiswaryarajendran2301 4 роки тому

    Thank you so much! This video was extremely helpful :-)

  • @TheOscarJB
    @TheOscarJB 5 років тому

    once again, thank you for your teaching, it is easier to understand, compared to my professor's teaching

  • @Mankind5490
    @Mankind5490 8 років тому

    Excellent Explanation. Thank you Tushar!

  • @hamzasaeedsippal
    @hamzasaeedsippal 6 років тому

    thanks. simply and clearly defined.

  • @thaneshwarsahu1633
    @thaneshwarsahu1633 6 років тому +1

    yes sir , your explanation process is very good and I'm very easily understand this tricky concepts
    thank you very much sir

  • @SkyGrain
    @SkyGrain 7 років тому

    Really great video, thank you very much !

  • @jahanvikhedwal1107
    @jahanvikhedwal1107 7 років тому

    Amazing explanation sir!!Thanks a ton.

  • @chandruscm
    @chandruscm 8 років тому

    Clear and to the point! Thanks a ton!

  • @Jaqen_Hghar
    @Jaqen_Hghar 6 років тому

    Thanks a lot, your videos are really very nice and clear. Helping me a lot in my Algorithm course.....

  • @riceboom360
    @riceboom360 4 роки тому

    the best explanation ever, thank you

  • @dimitrisdimitriou6969
    @dimitrisdimitriou6969 6 років тому

    The best explanation on LCS

  • @eagle_scientist
    @eagle_scientist 5 місяців тому

    thanks a lot, that's the explanation I was looking for

  • @sventhijssen1182
    @sventhijssen1182 8 років тому

    Thank you! Really clear and helpful!

  • @kalpkumudkumar8163
    @kalpkumudkumar8163 6 років тому

    nailed bro .... thanks I was struggling with this problem .. now it is much clear .

  • @impdev9828
    @impdev9828 6 років тому

    Great video, really helped my understanding. I find it quite difficult to see what algorithms are actually doing just by looking at wikipedia.