String Searching Algorithm
In computer science, string searching algorithms, sometimes called string matching algorithms, are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.
Let Σ be an alphabet (finite set). Formally, both the pattern and searched text are vectors of elements of Σ. The Σ may be a usual human alphabet (for example, the letters A through Z in the Latin alphabet). Other applications may use binary alphabet (Σ = {0,1}) or DNA alphabet (Σ = {A,C,G,T}) in bioinformatics.
In practice, how the string is encoded can affect the feasible string search algorithms. In particular if a variable width encoding is in use then it is slow (time proportional to N) to find the Nth character. This will significantly slow down many of the more advanced search algorithms. A possible solution is to search for the sequence of code units instead, but doing so may produce false matches unless the encoding is specifically designed to avoid it.
Read more about String Searching Algorithm: Other Classification
Famous quotes containing the words string and/or searching:
“The Indian remarked as before, Must have hard wood to cook moose-meat, as if that were a maxim, and proceeded to get it. My companion cooked some in California fashion, winding a long string of the meat round a stick and slowly turning it in his hand before the fire. It was very good. But the Indian, not approving of the mode, or because he was not allowed to cook it his own way, would not taste it.”
—Henry David Thoreau (18171862)
“Abode where lost bodies roam each searching for its lost one.”
—Samuel Beckett (19061989)