KMP Algorithm Part 1 | Prefix Function

  Рет қаралды 29,232

Fluent Algorithms

Fluent Algorithms

Күн бұрын

Пікірлер: 65
@ariel-h6j
@ariel-h6j 29 күн бұрын
This is the best explanation of prefix function of KMP algorithm Ive ever seen on youtube! Thank you so much for making this great video!
@galaxyspaceandtime9722
@galaxyspaceandtime9722 2 жыл бұрын
The best explanation I have ever seen of lps array to get intuition rather than getting code only. Thank you so much for helping me.
@deanwinchester8691
@deanwinchester8691 29 күн бұрын
There is a lot of Garbage on KMP in youtube but this is Pure Gold. Was able to get the idea of finding L effectively from this. No other video was able to explain it this thoroughly.
@shubhamsharma7934
@shubhamsharma7934 4 жыл бұрын
Thanks for the amazing video this algorithm is quite complex to grasp but after watching you video it is cakewalk
@chaitanyamanas1917
@chaitanyamanas1917 3 ай бұрын
I could not sleep for 2 days not understanding how we chose K less than L in the mismatch case, *thank you*!!
@cw5948
@cw5948 3 жыл бұрын
I appreciate you uploading this video. All the other videos I've looked at don't go into the mathematical rigor of how the PI prefix table is generated; they just give an algorithm which can be easily forgotten.
@mirshodmirjonov9971
@mirshodmirjonov9971 3 жыл бұрын
thank you bro, believe or not I have spend one day to learn this algo and now I understand logic, thank you sir again
@charanrajueluri3196
@charanrajueluri3196 Жыл бұрын
thank you so much. this is very easily understanded to me, previously i saw many videos they are not properly understanded to me but this video gave a clear picture about kmp longest prefix function
@motivation9718
@motivation9718 4 жыл бұрын
Great video man !!! Probably the most elaborated explanation on prefix function.
@fluentalgorithms4847
@fluentalgorithms4847 4 жыл бұрын
Thanks a lot!!
@Aman-gw7ro
@Aman-gw7ro 3 жыл бұрын
best explanation so far for kmp algo . Thanks a lot man for your efforts!!
@prashantkashyap171
@prashantkashyap171 Жыл бұрын
finally get it after wasting hours trying other videos. Quite good explanation
@sachinsingh1956
@sachinsingh1956 4 жыл бұрын
This is the best video i ever seen for kmp algo . you make kmp algorithm veri easy. Please try to make more video just like it for other algos , so that we can learn any algo in deep easily.
@inderjeetyadav2810
@inderjeetyadav2810 3 жыл бұрын
Very nice and simple explanation of a complex algorithm like KMP. Loved it.👍👍
@makaronpaka
@makaronpaka 8 ай бұрын
Thats an amazing explanation, thank you very much
@aryanchauhan6671
@aryanchauhan6671 3 жыл бұрын
You are awesome bro. Great explanation. Thanks, may God bless u.
@TaniaSketches
@TaniaSketches 4 жыл бұрын
Just wonderfully explained... Went through so many high profile videos... But could not understand... Thank you do much... Finally clearly understood... Awsome video....
@beingnikhil155
@beingnikhil155 3 жыл бұрын
This video helped me to visualize the article on cp-algorithms. Otherwise it was very confusing to me Thanks
@priyankarrajgupta4198
@priyankarrajgupta4198 3 жыл бұрын
You explained inner while loop max. iteration really well. That was the crux inorder to understand TC for prefix function. Thanks.
@KartikSingh-ew4mz
@KartikSingh-ew4mz 3 жыл бұрын
Beautifully explained !! out of the box
@ishayadav4595
@ishayadav4595 4 жыл бұрын
best explanation of prefix function on internet
@sitanshushukla1820
@sitanshushukla1820 4 жыл бұрын
Best Explanation... Couldn't grasp from cp algorithms. ur vdo helped a lot
@sangeethasanthiya284
@sangeethasanthiya284 Жыл бұрын
Vera level explaination clear understanding super sir
@c.feifei7953
@c.feifei7953 2 жыл бұрын
So well explained why j = failure[j -1] when the prefix-suffix match can't extend.
@sanskarmani9094
@sanskarmani9094 4 жыл бұрын
Explained as simply as possible. Love it.
@amitbendkhale646
@amitbendkhale646 4 жыл бұрын
So, is the O(n) thing like this: To get a drop of 't1' we should have moved earlier 'x1' steps in 'for loop' after the previous drop, and x1 >= t1 (otherwise drop wouldn't be possible); So like Complexity of Drops is Sum(ti)
@fluentalgorithms4847
@fluentalgorithms4847 4 жыл бұрын
Yup!
@amitbendkhale646
@amitbendkhale646 4 жыл бұрын
@@fluentalgorithms4847 Crystal clear explanation, one of the best videos in algos, thanks!
@THEkarankaira
@THEkarankaira 4 жыл бұрын
best explaintation avaiable on the internet watch it patienlty helped a lot thnak u
@ritikagupta8847
@ritikagupta8847 4 жыл бұрын
Thorough explanation. Thanks a lot
@em_nikhil_007
@em_nikhil_007 3 жыл бұрын
Thanks finally understood..
@harshraj22_
@harshraj22_ 4 жыл бұрын
Thanks . It was really helpful. Don't know why downvotes on codeforces.
@fluentalgorithms4847
@fluentalgorithms4847 4 жыл бұрын
I'm glad it was helpful! Thanks for watching!
@gaganganapathy9271
@gaganganapathy9271 3 жыл бұрын
Great video, thanks buddy! :D
@harshareddy2179
@harshareddy2179 4 жыл бұрын
Is the complexity you calculated for inner while loop amortized complexity of it?
@KaaiSpeaksHisMind
@KaaiSpeaksHisMind 3 жыл бұрын
Great work, thank you.
@nagarajhegde1197
@nagarajhegde1197 4 жыл бұрын
Great work, great explanation
@anuragporwal4664
@anuragporwal4664 4 жыл бұрын
excellent work.
@TEJASKUMAR-qv6gw
@TEJASKUMAR-qv6gw Жыл бұрын
best explanation
@ratanhegde9258
@ratanhegde9258 3 жыл бұрын
Thank you so much really helpful
@shashwattripathi759
@shashwattripathi759 4 жыл бұрын
amazing explanation...just amazing :O
@fluentalgorithms4847
@fluentalgorithms4847 4 жыл бұрын
Glad you liked it!
@shivamkushwaha9730
@shivamkushwaha9730 4 жыл бұрын
Good explanation. People who dislike it, please write a reason for that. Don't just press the button.
@sanskarmani9094
@sanskarmani9094 4 жыл бұрын
How can we convert this algorithm so that we have no overlap between prefixes and suffixes? Meaning that lps[i]
@7687saurabh
@7687saurabh 3 жыл бұрын
k denotes next longest string which is a proper prefix and a proper suffix for substring 0 to i. Shouldn't the value of k should simply be l-1? Its not obvious why it is pie(l-1) rather than l-1.
@discussionforum7161
@discussionforum7161 4 жыл бұрын
This was a topic i thought to explain but after i seeing your video i think it's been done in a good way already .
@sahilsharma2952
@sahilsharma2952 4 жыл бұрын
Really helpful. Thanks.
@sachin__ak
@sachin__ak 2 жыл бұрын
why stop uploading videos we need more videos from you about different algorithms
@sanchitkumawat3803
@sanchitkumawat3803 4 жыл бұрын
awesome explanation bro
@sandipjana5553
@sandipjana5553 4 жыл бұрын
awesome explanation
@smol_cute_penguin
@smol_cute_penguin 28 күн бұрын
what was this everything was over the head, have to watch again
@Prince-wv8nm
@Prince-wv8nm 2 жыл бұрын
GREAT
@ritikagupta8847
@ritikagupta8847 4 жыл бұрын
if the string is "aaaaaaaaaab" then the inner while loop will run ~n times the complexity will be O(n^2)??Am I correct?
@sachinsingh1956
@sachinsingh1956 4 жыл бұрын
O(1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 9) = O(19) inner while loop run only one time for n times but in rest of case it will run only one time .
@ritikagupta8847
@ritikagupta8847 4 жыл бұрын
@@sachinsingh1956 thank you
@haniariimaukloo3892
@haniariimaukloo3892 Жыл бұрын
why is pi of 8 equal to 1 and not 2? Ps: I'm referring to the last example
@manusabuu
@manusabuu Жыл бұрын
I have same doupt
@manusabuu
@manusabuu Жыл бұрын
How pi (7 ) =1?
@VIVEKKUMAR-kt2ey
@VIVEKKUMAR-kt2ey 3 жыл бұрын
Thanks bro
@amanr11314
@amanr11314 3 жыл бұрын
bro after much re-watching the video i still can't understand the line if(s[i]==s[pi[i-1]]) pi[i] = pi[i-1] + 1;
@ferfle
@ferfle Жыл бұрын
thx
@ayushsingh-hd5ld
@ayushsingh-hd5ld 4 жыл бұрын
I am not able to understand the time complexity part
@samvidhaansingh1453
@samvidhaansingh1453 Жыл бұрын
Toughest topic yet.
@shubhamk840
@shubhamk840 4 жыл бұрын
why does this video has so less views.
@enchantularity
@enchantularity Жыл бұрын
Hi I have the pattern "zyxwabacddfghabacdjhlop" . Won't pi function return all zero? There are two patterns , one prefix, another suffix . Will your algorithm work here ?
KMP Algorithm Part 2
16:11
Fluent Algorithms
Рет қаралды 4,5 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 33 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 120 МЛН
Я сделала самое маленькое в мире мороженое!
00:43
Кушать Хочу
Рет қаралды 4,6 МЛН
9.1 Knuth-Morris-Pratt KMP String Matching Algorithm
18:56
Abdul Bari
Рет қаралды 1,6 МЛН
Rabin-Karp Algorithm | Searching for Patterns | GeeksforGeeks
11:32
GeeksforGeeks
Рет қаралды 271 М.
Manacher's Algorithm | Longest Palindromic Substring
21:47
Fluent Algorithms
Рет қаралды 29 М.
9.2 Rabin-Karp String Matching Algorithm
23:50
Abdul Bari
Рет қаралды 792 М.
Knuth-Morris-Pratt algorithm (KMP) - Inside code
22:01
Inside code
Рет қаралды 20 М.
Knuth-Morris-Pratt(KMP) Pattern Matching(Substring search)
12:50
Tushar Roy - Coding Made Simple
Рет қаралды 1,1 МЛН
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 33 МЛН