Brute-Force Substring Search Algorithm

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

This lecture is about the brute-force substring search algorithm. So the aim is to find a P pattern in a given T text. We can do it with brute-force substring search with O(|P||T|) running time. Can we do better? Of course, we can even achieve O(|P|+|T|) running time with Z substring search algorithm.

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

Thank you so much for this wonderful explanation <3

badreddine
Автор

Thanks you Sir, it's clearly understood after watching the video

teryiladaniel
Автор

I could not wrap my head around that charAt[i + j] but as soon as I saw the image it snapped in my brain :) thank you

imagineabout
Автор

hi
when you run this function it will return lengthOfText and it is a wrong ans because it should return the index i
but when we make the first loop like that for(int i =0 ; i<= lengthOfText - lengthOfPattern; i++) it will work an return the index i because missing = will cause a wrong return
the prove of that when you change the pattren from TEXT to TEX it will return the index i
Please correct me if I am wrong and thanks

engmahmoudellahone
Автор

awesome explanation, please make more videos on algorithms

ashish_wanderer
Автор

Hi
Can I get the code for this topic?

roaaaon
Автор

what if it wasnt ddds but some element and then ddds like addds or bddds then what is the procedure for brute force.

darshanadarkar
Автор

can someone give me a link to pseudocode program? bc im to dumb to find it myself

fishesisgood
Автор

thank you so much usefull to us in exam

kumarrathod
Автор

The bottom part is obscure what does the ( i + j ) means ?. Could you explain more the bottom part starting from the nested forloop. What does the nested forloop do ?. Also this is applicable when we have the key like in your example "test" what about if we need to guess the key or pattern what we need to look for to find the pattern ?

Noah-
Автор

My favourite part is the pseudocode not actually being remotely close to pseudocode.

Sausytime
Автор

thanks for the video, but in the pseudocode the outer loop declaration is wrong.
the second argument shoulde be: i <= lengthOfText - lengthOfPattern instead of i<...

mynameis
Автор

ive never heared this accent before.. is this iranian accent?

mhdamayri
Автор

If brute force was a slower, then which one is faster than brute force

uppalaadarsh
Автор

don't know the meaning of naive and intuitive .

harshhwardhanrai
Автор

Computer science is just the worst course to study. Nobody will ever explain this things to you

kaleghavera
Автор

seems that he is mocking an accent very badly!

ahmad