String-searching algorithm: Difference between revisions

Content deleted Content added
Pcordes (talk | contribs)
Single-pattern algorithms: As discussed earlier in the page, the average case for naive searching is Θ(n+m), when potential matches are rejected in O(1), not scaling with the total length of the needle. (I might have said "typical" instead of "average", but for consistency with the other entry let's say average)
Tag: Reverted
Line 7:
 
== Overview ==
The most basic case of string searchingwritting involves one (often very long) string, sometimes called the ''haystack'', and one (often very short) string, sometimes called the ''needle''. The goal is to find one or more occurrences of the needle within the haystack. For example, one might search for ''to'' within:
 
Some books are to be tasted, others to be swallowed, and some few to be chewed and digested.