KMP Algorithms - String Algorithm | C++ Placement Course | Lecture 39.3

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

You need to understand, teaching and explaining is two different things, you just went on explaining it step by step. 0 clarity of what is going on.

aishwaryadwani
Автор

I suggest you please explain first broadly before jumping into the code. We can understand the code by ourselves or also there are many websites for code. Please explain using example first, dry run, and then write code. Thanks

dishanamdev
Автор

Apko knowledge hae but teaching skills nahi hae 😶

bhupeshpattanaik
Автор

I think it's pretty good lecture for someone reads blogs and tutorials then watches videos for doubt clearing.

jobayersakib
Автор

Worst explanation, naively explaining code rather than telling the intuition and "saying jabtak milega ni toh piche chalta jaega".
But why j=pi[j-1] and how it works ???
Tu kya coder banega re.

NikhilKumar-ofgb
Автор

Sorry didn't explained concept very good. Improve voice and narration

luckysharma
Автор

good explation bro....saved a lot of my time..

adityaprakash
Автор

didi pls ap explain karo iske liye ek bar

rxxxx
Автор

At 5:10, you said for index = 5, the substring is "abcabc", prefix of length 1 and suffix of length 1 is equal. But it clearly is not equal. You also said that prefix of length 2 and suffix of length 2 is also equal, but it ain't equal.

The prefix of length 3 and suffix of length 3 is equal, so I think that the maximum K such that
s[0...k-1] = s[i-(k-1)....i]
this is applicable in the following example
"abcabcdefabcabc"
The k here can have possible values - 3, 6 and the max of them is 6 so k should be 6.

ayushasutkar
Автор

Apni kaksha ka mtlb bas microsoft vali ma'am baki sab bas time paas kr rhe

willturner
Автор

Koi better resource suggest kardo plz kmp ka...yaha to code likh diye bas..

shivanshtiwari
Автор

wrong code! in pattern matching when two char are not equal then j is updated and the position at which match was found is already gone because j is reset it should be placed above.

himanshukaushal
Автор

No one has explained this theoram the way this person has explained ❤️

adityavarma
Автор

Was this the video for explanation of prefix along or KMP?🥴🥴

wisdomkhan
Автор

Every time when I see your channel it feels coding and placement in companies is easy your lectures give me positive waves and encourage me to work hard,
From my deep heart, I just want to say thank you so much Aman Bhaiya.

Rest_leave
Автор

some problem suggestions please using this concept??

acousticIndie
Автор

I THINK ANDROID DEVELOPEMENT MUST BE COMING! FELING VERY MUCH EXXCITED ABOUT IT...

nishant_singh
Автор

kmp algo is showing incorrect answer for text="aabaaabaaac" and

createownhappiness
Автор

Dear team, please tell us why are you all not putting the new videos in the playlist?

skundverma
Автор

USE THIS CODE INSTEAD OF THE ONE THAT IS SHOWN IN VIDEO BECAUSE THE ONE SHOWN IN THE VIDEO DOES NOT PASSES ALL THE TEST CASES

vector<int> prefix_function(string s) {
int n = s.length();
int i = 1;int j = 0;
vector<int> ans(n, 0);
while(i<n)
{
if(s[i]==s[j])
{
j++;
ans[i] = j;
i++;
}
else{
if(j==0)
{
ans[i]=0;
i++;
}
else{
j = ans[j-1];
}
}
}
return ans;
}

abhinavsaxena