Комментарии:
Greatly explained, i saw a couple other videos but yours made me really understand it
ОтветитьKING 👑
ОтветитьI can tell coders for normal people. Normal people count 1, 2, 3, … Coders do not count, they calculate memory address offsets 0, 1, 2,…
ОтветитьSo you want to find the location of each proper suffix which is also a prefix of the pattern?
Ответитьexplained very well thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ОтветитьIt's a little misleading as to what part of the algorithm actually "saves work". Positive values in the KMP table force the algorithm to backtrack and try different parts of the match string p against s. Because the KMP table accounts for backtracking, the search through s can continue on after mismatches, without backtracking, as long as there are no entries in the KMP table. So even if the lookup table were completely empty, this offers a huge speedup
Ответить(volume - 10) + (repetition / 10) = watchable.
ОтветитьVery, very poorly explained.
ОтветитьThanks you're awesome.
ОтветитьSo far this is the first algorithm that made me stop and think for a while
ОтветитьExcellent explanation!
Ответитьwow
ОтветитьI love his energy. Hard to loose focus.
Ответитьwhy are you yelling bro?
ОтветитьHi, what is the point in making an entry in the border table for the last character in the substring? As there cant be a mismatch that requires its use? Once you get to that point in the substring you'll either find a match and the algorithm terminates, or you find a mismatch and look at the border of the table[0...7]
Ответитьthansk man
ОтветитьTop-notch content
ОтветитьThank you~
ОтветитьAdvance one to be recognized
ОтветитьCan we just concatenate, the first string and find the position of second string like if it exits?
ОтветитьGreat Video,KMP is now crystal clear to me .Thanks !!!
Love from India♥
Unrelated but Donald Knuth's last name is pronounced like "Ka-Nooth" Great explanation, very clear.
Ответитьyou explained it so nicely
ОтветитьBrilliant explanation - certainly one of the best for the KMP algorithm. I like how you focus on the intuition behind the algorithm, as opposed to the traditional textbook approach. Have you considered writing a book on algorithms?
Ответитьdo they really think we'll be able to come up with this shit on our own in 30 minutes during a technical interview??
ОтветитьPerfect explanation. Thank you so much!
ОтветитьTerrific 🔥🔥
ОтветитьYou are becoming my first choice for learning any new algorithm. Keep uploading👍 Hats off👏
ОтветитьYay I think I understand it at last, thanks man!
ОтветитьThanks! Very clear, detailed and energetic!!
ОтветитьFind the longest suffix which is also the prefix to save us from reverting the searching. Thanks!
Ответитьit was a great help. Thanks man
Ответитьwhat a bs video, you failed to utilize the best example of the algorithm... now you've literally matched from start to end
ОтветитьYou've got the gift of explaining the concept
Ответитьwell done bro
ОтветитьThank you from my heart.
I was about to give up on this algorithm, until I found this video, I appreciate this work so much.
just amazing explanation bro!
Ответитьdude you need to chill when explaining
ОтветитьLeetcode easy????
Ответитьnever been so confused
ОтветитьI hope I am never asked this question, great explanation.
ОтветитьAmazing content. I've been going through your videos and they are so helpful!
ОтветитьGreat explanation. I never got the intuition of why prefix/suffix works, but not anymore !
ОтветитьPretty good explanation
ОтветитьFunction to create the lpsArray according to explanation :-
public static void lpsArray(String s) {
int a[] = new int[s.length()];
a[0] = 0;
int i = 0;
for (int j = 1; j < s.length(); j++) {
if (s.charAt(j) == s.charAt(i)) {
i++;
a[j] = i;
} else {
if (i - 1 < 0) {
i++;
}
i = a[i - 1];
a[j] = i;
}
}
for (int x : a) {
System.out.print(x + " ");
}
}