## Find Pattern And Its Anagrams In A Text

We will be solving here a LeetCode problem. The problem is to find a pattern & all its anagrams in a String. You will find similar problem in InterviewBit or GeeksforGeeks too. Problem: Given two strings s and p, return an array of all the start indices of p’s anagrams in s. You may return … Read more

## How Asynchronous Ajax Calls Get Executed In JavaScript Event Loop

We know JavaScript is single threaded. And we know it uses event loop architecture. Event loop runs in a single thread & executes code. There are tons of articles out there regarding this. So without going into same thing again, I want to touch upon a follow up topic on this. If event loop runs … Read more

## KMP Algorithm Explained In Plain English

Here I am just trying to explain KMP algorithm in plain english. I will also explain worst time complexity & why it is O(m + n). We will take two examples, one with no repeatable character in the pattern & another with repeatable characters in the pattern. Pattern With Repeatable Characters: Text: aaaabaabab Pattern: aaaaa … Read more

## Simple Explanation Of Rabin-Karp Pattern Matching Algorithm

In this post, I will try to explain Rabin-Karp algorithm & its worst time complexity. Rabin-Karp algorithm is based on hash matching.   Let’s take an example. Text: aadabcPattern: abc   Let’s create a table as below & represent each letter with some arbitrary number. We will use it to calculate hash. a b c … Read more