9.1 Knuth-Morris-Pratt KMP String Matching Algorithm

  • 🎬 Video
  • ℹ️ Description
preview_player
UCZCFT11CWBi3MHNlGf019nw

In P3, b is also matching , lps should be 0 1 0 0 1 0 1 2 3 0

Naive Algorithm
Drawbacks of Naive Algorithm
Prefix and Suffix of Pattern
KMP Algorithm



Courses on Udemy
================
Java Programming

Data Structures using C and C++

C++ Programming

💬 Comments
Author

Computer Science students will always be thankful to this legend ❤

Author — Usman Khan

Author

this guy achieves to teach things in 20 minutes that university teachers fail to teach in hours

Author — Richárd Szegh

Author

The best KMP algorithm explanation on YouTube.

Author — Luke Morrice

Author

At 11:33 on pattern P3 aab should be 123 instead of 120

Author — Priyabrata

Author

wish all these great tutorials were available when I was doing my graduation.

Author — Manish Kumawat

Author

This man has singlehandedly helped me through so much of my undergrad degree. All for free. I can’t thank you enough Mr. Bari!

Author — Souvik Maiti

Author

You teach me how to appreciate the beauty of algorithms.
Thank you so much.

Author — Chimao Lin

Author

Mr Bari, you're truly a gem. None of the videos online could explain these concepts as clearly as you. Really appreciate what you are doing!

Author — tashfia shamim

Author

As always my professor out here dropping gems on us humble students. Much love. We appreciate you

Author — P G.N

Author

Thank you enormously from the Netherlands !

Author — Alexander Safi

Author

You might have heard it many times, but still I prefer mentioning it that all these efforts you made to make such valuable contents free of cost is amazing, This is going to serve many programmers for the next coming years as well. Be it your way of explanation, your intuition every thing is just perfect. And we the programming community is thankful to you sir.


I do hope that you will be making more videos in the coming years. That is the only negative thing that I hear about this otherwise wonderful channel it that the advanced data structures and algorithms are not being covered. This is just a feedback from someone who has been following your videos for quiet a long time.


Again thank you sir

Author — Mamta Chahal

Author

This is the best explanation I have ever seen. I have searched for several videos, most of them just focus on implementing without much reasoning. However, after watching this video, I fully understood the principle behind KMP and implemented the algorithm by myself. Thank you very much.

Author — guifan weng

Author

Literally one of the best explainations of KMP on internet :) Keep it up sir.

Author — Shantanu Sharma

Author

A very lucid explanation to a complex algorithm. Thank you very much sir.

Author — Itz Cs

Author

Dude I love the video so much. When you found that last match it gave me a big smile. This algorithm is cool! You do such a great job explaining the concept. Thank you for the video.

Author — Zalgo the Destroyer

Author

Sir, you should definitely create a bootcamp course for technical interviews, you ll save so many lives. Thank you for all your efforts sir !

Author — priya v

Author

sir we absolutely love your videos, if you could pls include the algorithms for all these concepts too!

Author — Surabhi Sharma

Author

Literally Sir You Are God, The Way You Teach is Just Beyond Imagination, Thankyou So Much For Making The Topic So Easy & Understandable.

Author — vansh varshney

Author

You are awesome! Can you do video of Amortized analysis and loop invariant next time? I feel like these 2 topics are hard to understand

Author — Sharon Denys

Author

Thank you.
It was hard to understand the Prefix and Suffix concepts in the context of String Pattern Matching, which was clarified easily.

Author — Anit Shrestha Manandhar