# Category Archives: Pattern Searching

We strongly recommend to read following post on suffix trees as a pre-requisite for this post.Pattern Searching | Set 8 (Suffix Tree Introduction)A suffix arrayâ€¦ Read More
Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true ifâ€¦ Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You mayâ€¦ Read More
Pattern searching is an important problem in computer science. When we do search for a string in a notepad/word file, browser, or database, pattern searchingâ€¦ Read More
In the previous post, we discussed the Finite Automata-based pattern searching algorithm. The FA (Finite Automata) construction method discussed in the previous post takes O((m^3)*NO_OF_CHARS)â€¦ Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You mayâ€¦ Read More
Question: We have discussed the Naive String matching algorithm here. Consider a situation where all characters of a pattern are different. Can we modify theâ€¦ Read More
Given a text txt[0. . .n-1] and a pattern pat[0. . .m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[]â€¦ Read More
Given a text txt[0..N-1] and a pattern pat[0..M-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You mayâ€¦ Read More
Naive Algorithm: i) It is the simplest method which uses brute force approach.  ii) It is a straight forward approach of solving the problem. iii)â€¦ Read More