Naive Algorithm for Pattern Searching | GeeksforGeeks

preview_player
Показать описание
Our courses :

This video is contributed by Meenal Agrawal.

Please Like, Comment and Share the Video among your friends.

Install our Android App:

If you wish, translate into the local language and help us reach millions of other geeks:

Follow us on Facebook:

And Twitter:

Also, Subscribe if you haven't already! :)
Рекомендации по теме
Комментарии
Автор

1:47 Can someone explain to me how to create this animation on Vegas pro? The borders around the text, the background color for each letter etc

wejesuss-
Автор

gotta prep for tomorrow's test
my mind: 04:11

martinsantiago
Автор

I have been doing this with setting my outer loop's condition as i < n only and it has been working.
Never thought i < n - m would work and actually now looking at it, be a better solution!

Appreciate sharing this solution.

Moosorkh
Автор

What about this in python??
def naive(text, pattern):
n = len(text)
m = len(pattern)
for i in range(n - m + 1):
if text[ i : i + m ] == pattern:
print("Pattern found at index:", i)

saibabanadhatwork
Автор

why after putting brackets after 2nd for loop and if conditions my code didn't give output but after removing them it shows the output??
this problem is really confusing me

lakshitajoshi
Автор

why is char* needed for? cant we use string &txt ?

drunkirk
Автор

Isn't outer loop run N-M+1 times?

thishandharmakeerthi
Автор

Thank you, but where's KMP video

Odo_ela_sabil_rabek
Автор

fucking thing is at last I wanted to note those time complexities this fucking tube just comes and shows other vids suggestion

siddeshwarvasam
Автор

please everybody correct ur code:
in the 2nd last if block the correct condition should be:-
if( pat[i+j]!=txt[j])

AllTypeShorts..
visit shbcf.ru