Rolling Hash Function Tutorial, used by Rabin-Karp String Searching Algorithm

preview_player
Показать описание
In this tutorial we are going to discuss how to implement a "rolling hash function". We will derive a concrete implementation and show how it could be used to efficiently find a pattern string in a text. The search algorithm that makes use of it was invented by Richard M. Karp and Michael O. Rabin (1987).

The main benefit of a rolling hash function is that regardless of the length of the search pattern, we do a constant number of operations to compute the next hash value.

Making use of this property of modulo multiplication:
(A * B) mod C = ((A mod C) * (B mod C)) mod C
we show how the hash could be computed without having to deal with large numbers.

Written and narrated by Andre Violentyev
Рекомендации по теме
Комментарии
Автор

After searching and reading through a lot of sources, this is the only video that explains every detail clearly! Really good explanation!! Thanks.

tanyakejriwal
Автор

Easily top 5 most eloquent algorithm teachers on YouTube, thank you for the amazing lesson!!

TANEM
Автор

Dude you killed this topic. No one explained this topic in detail other than you

sreeram
Автор

I searched for a long time for different materials on this algorithm, until I came across your video - it is the best explanation, thank you!

illyafedyniak
Автор

Brilliant. Please keep making videos <3

michaelgirma
Автор

Best video to include all details! Thanks a lot !

MieA
Автор

I rarely comment on videos, but this was an extremely well explanation so I had to write something. I hope you make more videos. Thanks for this!

joeellis
Автор

This content deserves millions of subs, I hope you make more videos soon!

dashdoom
Автор

This is one of the best videos I've seen to understand algorithms. Sir, thank you so much for this...and please upload more often!!

vaanibansal
Автор

You are so amazing! I was struggling with understanding Rabin kerp and rolling hash but now it’s very clear! Thank you so much!!!

moyo
Автор

Wow, that was marvelous. You are an outstanding algorithm teacher. You give people just the right amount of explanation necessary for understanding a concept. Your videos are not long and not short; they are just the perfect length. Well done on that, and please keep going. The community needs more content like this one.

amaama
Автор

Your sanity check completely cleared my doubt thanks🇮🇳

_harshdeepraghuwanshi
Автор

I love your content and simple explanations, they are really helpful

kushagrashekhawat
Автор

Super clear explanation to a complete beginner - was following MIT's course and was lost but this video completely breaks down the intuition behind why a rolling hash is computed this way! thanks

hq_films
Автор

Thanks! I really liked your explanation!

erdeneboldbattulga
Автор

Great video...concise yet clear...looking forward to the KMP explanation video..cheers

piyushmishra
Автор

Great video, definitely deserves more views.

justinlam
Автор

Great video! Thank you for your explanation!

leonardocalderon
Автор

Best video on Rabin-Karp. Very nicely explained.

GANDHIXtv
Автор

Really needed this short <10 min video have an exam in a few hours!

MuhidAbidpoint