LeetCode #28: Find Index of First Occurrence in a String | KMP Algorithm

preview_player
Показать описание
A step-by-step visualization of #LeetCode question 28: Find the Index of the First Occurrence in a String (KMP Algorithm)

0:00 Problem Description
0:51 Brute Force Solution
2:53 KMP Algorithm
5:30 Preprocessing Algorithm
9:11 Code Walkthrough

#algorithms #coding #programming
Рекомендации по теме
Комментарии
Автор

2:53 one of the best KMP Algorithm explanation. This channel is so underrated and most efficient way of visual presentation with the code line. So easy to follow up and understand. Thank you so much.

ocoocososococosooooosoococoso
Автор

Hi Algo engine, it’s surpriseme here from leetcode. I m still stuck at this video after one week. I m gng to try learning it again tmr. I went to read up and watch more about big o notation after I m stuck. I m planning to write about the KMP algorithm on my website in a few weeks time and hope u r ok that I post ur video in that article. Glad that we can comment here now! Thank you for all ur hard work in helping us!

sohsueping
Автор

this is the hardest algorithm that i have ever seen

himanshu_tt
Автор

Great video as always! I am new to this and I would like to ask, is it sensible to add "break" after returning h - n + 1 to prevent further unnecessary iteration and make the program faster? And can you tackle a problem including linked-lists, I try to understand how they work and how to work with them but they are a bit confusing. Thanks!

alperenakbas
Автор

Hi, can you explain more for time range 6:43–6:53?
Why 'a' is an LPS?
I thought the LPS is "ab".

Overall, great explanation!!!

yusufnurwahid
Автор

Hello, thanks for the videos ! They're really helpful. I'm a beginner and would like to know which leetcodes problem to focus on to have a well rounded base and make it easier to solve more complex ones later on ?

JimmySquiky