 |
|
| |
|
 |
 |
at Global Oneness Community.
Share your dreams and let others help you with the interpretation!
Dream Sharing Forum
|
 |
String searching algorithm - Other classification |  | String searching algorithm - Other classification: Encyclopedia II - String searching algorithm - Other classification |  | Other classification approaches are possible. One of the most common uses preprocessing as main criteria.
String searching algorithm - Naïve string search.
The simplest and least efficient way to see where one string occurs inside another is to check each place it could be, one by one, to see if it's there. So first we see if there's a copy of the needle in the first few characters of the haystack; if not, we look to see if there's a copy of the needle starting at the second character of the haystack; if ...
See also:String searching algorithm, String searching algorithm - Basic classification, String searching algorithm - Single pattern algorithms, String searching algorithm - Algorithms using finite set of patterns, String searching algorithm - Algorithms using infinite number of patterns, String searching algorithm - Other classification, String searching algorithm - Naïve string search, String searching algorithm - Index methods |  | | String searching algorithm, String searching algorithm - Algorithms using finite set of patterns, String searching algorithm - Algorithms using infinite number of patterns, String searching algorithm - Basic classification, String searching algorithm - Index methods, String searching algorithm - Naïve string search, String searching algorithm - Other classification, String searching algorithm - Single pattern algorithms, Algorithm |  | |
|  |  | String searching algorithm: Encyclopedia II - String searching algorithm - Other classification
String searching algorithm - Other classification
Other classification approaches are possible. One of the most common uses preprocessing as main criteria.
String searching algorithm - Naïve string search
The simplest and least efficient way to see where one string occurs inside another is to check each place it could be, one by one, to see if it's there. So first we see if there's a copy of the needle in the first few characters of the haystack; if not, we look to see if there's a copy of the needle starting at the second character of the haystack; if not, we look starting at the third character, and so forth. In the normal case, we only have to look at one or two characters for each wrong position to see that it is a wrong position, so in the average case, this takes O(n + m) steps, where n is the length of the haystack and m is the length of the needle; but in the worst case, searching for a string like "aaaab" in a string like "aaaaaaaaab", it takes O(nm) steps.
KMP computes a deterministic finite state automaton that recognizes inputs with the string to search for as a suffix, so it doesn't need to back up. Boyer-Moore starts searching from the end of the needle, so it can usually jump ahead a whole needle-length at each step. Baeza-Yates and Gonnet uses bits in a word to keep track of whether the previous j characters were a prefix of the search string, and is therefore adaptable to fuzzy string searching. The bitap algorithm is an application of Baeza-Yates' approach.
String searching algorithm - Index methods
Faster search algorithms are based on preprocessing of the text. After building an index, for example a suffix tree or suffix array, these algorithms can find pattern quickly, using a binary search of the index.
Other related archivesAho-Corasick algorithm, Algorithm, Algorithms on strings, O, Search algorithms, algorithms, binary search, bioinformatics, bitap algorithm, finite state automaton, fuzzy string searching, patterns, regular expression, regular grammar, string algorithms, strings, suffix array, suffix tree
 Adapted from the Wikipedia article "Other classification", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |
|
|
More material related to String Searching Algorithm can be found here:
|
|
« Back
|
Search the Global Oneness web site |
|
|
|
|
 |
Sneak-Peek of Global Oneness Community
Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas
Forum Home,
Articles,
Photo Gallery,
Videos,
News,
Sitemap
...and much more!
|