## Dynamic Programming | Wildcard Pattern Matching | Linear Time and Constant Space

Given a text and a wildcard pattern, find if wildcard pattern is matched with text. The matching should cover the entire text (not partial text).… Read More »

Given a text and a wildcard pattern, find if wildcard pattern is matched with text. The matching should cover the entire text (not partial text).… Read More »

Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function that prints all occurrences of pat[] in txt[]. You may assume that n >… Read More »

Given a string s, find length of the longest prefix which is also suffix. The prefix and suffix should not overlap. Examples: Input : aabcdaabc… Read More »

Given a numeric string (length <= 32), split it into two or more integers( if possible), such that 1) Difference between current and previous number… Read More »

Given a 2-Dimensional character array and a string, we need to find the given string in 2-dimensional character array such that individual characters can be… Read More »

You are given two string str1 and str2 of same length. In a single shift you can rotate one string (str2) by 1 element such… Read More »

Given a input string and a substring. Find the frequency of occurrences of substring in given string. Examples: Input : man (pattern) dhimanman (string) Output… Read More »

Given an alphanumeric string, find the number of times a pattern 1(0+)1 occurs in the given string. Here, (0+) signifies the presence of non empty… Read More »

In Set 1, we have discussed general approach for counting the patterns of the form 1(0+)1 where (0+) represents any non-empty consecutive sequence of 0’s.In… Read More »

A string contains patterns of the form 1(0+)1 where (0+) represents any non-empty consecutive sequence of 0’s. Count all such patterns. The patterns are allowed… Read More »

We have already discussed Bad character heuristic variation of Boyer Moore algorithm. In this article we will discuss Good Suffix heuristic for pattern searching. Just… Read More »

is_permutations() is used to check if two containers like string and vector are permutation of each other. It accepts three parameters, the first two parameters… Read More »

Given two string, in which one is pattern (Pattern) and other is searching expression. Searching expression contains ‘#’. The # works in following way: A… Read More »

Given two strings s and t. The task is to find maximum length of some prefix of the string S which occur in string t… Read More »

Given a string str that may contain one more occurrences of “AB”. Replace all occurrences of “AB” with “C” in str. Examples: Input : str… Read More »