Karp-Rabin String Matching Algorithm | Substring Search Pattern
HTML-код
- Опубликовано: 30 сен 2024
- Discover the inner workings of search engines like Google! In this video, we'll explore the Karp-Rabin algorithm, a powerful technique for efficient string searching using hashing.
Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!
👉 Resources
- Join Replit: join.replit.com...
- Lecture code: replit.com/@Ku...
- Complete Java DSA playlist: • Java + DSA + Interview...
- Code, Assignments, & Notes: github.com/kun...
➡️ Connect with me: kunalkushwaha.com
👨💻 Join WeMakeDevs: wemakedevs.org
#dsa #placement
DSA + interview preparation playlist: ruclips.net/p/PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ
If anyone is new to this bootcamp! Let me tell you it's amazing I've completed almost every single videos so far. By the end of the playlist you'll have so much confidence to tackle DSA questions by your own.
Just make sure you're following the notes + assignments & Tips that kunal gives !!
Some tips that I always remember when i approach a problem (kunal has mentioned it)
- Don't memorize, understand the problem / logic
- Hard Question is easy for those who have studied, Easy Question is hard for those who haven't
- The function will return from where it was called !! ( Recursion )
That last thing is the most important
Best course i suggested many friends ❤❤❤❤
Thanks, sir!!
I guess the CalculateHash function will get to the limit of mathematical computations. suppose str.length() is around 1000
It would need to calcu;ate 101^1000 and that is out of bounds of long storage, and I guess pow() too couldn't cacluate it.
👉 Resources
- Join Replit: join.replit.com/kunal-kushwaha
- Lecture code: replit.com/@KunalsReplit/KarpRabin-Hashmaps
Kunal that updateHash method is kind of clever ha!! nice technique!!! Thanks for sharing your knowledge!!!!
These videos are so great, i am also done with each and every video, and just looking forward for notification of new Videos, .... It would be very grateful of Mr. Kunal if he could be more frequent in uploading videos, ❤❤ i don't have much patience for your videos
Sigma uploaded 2 videos at 3 am
I don't really understand the updateHash function
At 2:20 the example ur explaining is sliding window technique with a TC of O(26*N)(for this problem) = O(N)
By the way Big Fan bruh❤️
Ninnu ekkado chusa bhayya
Yes he said its O(n*n) which is wrong
String has a function called contains( " "). It has Log n complexity :) , Rabin karp can be said as more algorithmic approach whereas contains can be classified as general apporach
Ya your right ✅ I'm also thinking we can use contain function to why so use this
Yes but it will give Boolean answer but we need the index
Second video on same day❤
Love from Jashore University of science and technology ,Bangladesh Sir❤. I am from non cs, following you to be a selftaught programmer.
Would this work using something non-prime?
I like to say Rabin-karp is it okay
yes
of course he just wanted to be cool about that
what if we need to count that how many times b string contains a
Just use a counter variable, and in the condition where all characters match, increase counter by 1.
At the end when the loop ends either return or print the value of counter.
Can anyone pls explain why we divide by prime in order to get new hash
since we were multiplying with prime in order to calculate the hash with that character and now since we want to remove that character from our window therefore we need to not just subtract that character but as well divide the new hash with the prime.
@@aveshsingh491
tq so much
Great video
Cant we just use b.contains(a)?
That also uses an algorithm similar to this one .
not able to understand line no 13
got it
GOAT for a Reason....👍
Thanks Kunal!!
Inspirational ❤❤❤
Wah ek sath
🙏👍
❤❤❤
Bro actually it takes n-pattern length times iterated and in each iteration it takes two iterations of length of pattern for generating hashcodes and also checking for same characters or not, if hash is matched
Finally it also take O(nxm ) time ❤
Tell me if im wrong☺️
But krunal playlist is awesome🧡🧡🧡
Hey kunal can you give a refferal to me
no
@@KunalKushwaha ok but please make a video for how to apply for Google
@@KunalKushwaha40lpa fraud will refer? LOL
made fools out of lakhs of people and that devops course has gone extinct
just uploads promotion videos of tools these days.. free free ke chakkar me big scam of trust... fraudster kunal
@@KunalKushwahaYou wont reply to or atleast complete your bootcamp
but youll show arrogance for someone asking you a referral politely.. karma hits back fraudster... played games with trust,viral controversies,hype.. and the end result is zero..
@@KaizokuOuNarutowhat karma bro, if you don't like him don't watch his videos.
Previously these types of detailed courses were paid, a kind man started it for free while managing his own work, and you're calling him fraud!!!!!
Cheap mentality 😞