skip to main content
article
Free Access

A very fast substring search algorithm

Published:01 August 1990Publication History
Skip Abstract Section

Abstract

This article describes a substring search algorithm that is faster than the Boyer-Moore algorithm. This algorithm does not depend on scanning the pattern string in any particular order. Three variations of the algorithm are given that use three different pattern scan orders. These include: (1) a “Quick Search” algorithm; (2) a “Maximal Shift” and (3) an “Optimal Mismatch” algorithm.

References

  1. 1 Boyer, R.S., and Moore, J.S. A fast string searching algorithm. Commun. ACM 20, 10 (Oct. t977), 762-772. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Guibas, L.j., and Odiyzko, A.M. A new proof of the linearity of the Boyer-Moore String Searching Algorithm. SIAM J. Comput. 9, 4 (No,:. !980), 672-682.Google ScholarGoogle Scholar
  3. 3 Knuth, D.E., Morris,J.H., and Pratt, V.R. Fast (June 1977), 323-350.Google ScholarGoogle Scholar
  4. 4 Smit, G.V. A comparison of three string matchin~ algorithms. Solho.--Prac. andExb. 12. I (lan. 19~32), 57-66. - " ' 'Google ScholarGoogle Scholar

Index Terms

  1. A very fast substring search algorithm

    Recommendations

    Reviews

    Ralph Walter Wilkerson

    The substring search algorithm described in this paper is an extension of the well-known Boyer-Moore algorithm. Unlike the Boyer-Moore algorithm, which requires scanning the pattern string in reverse order, this algorithm is not dependent on the scan order of the pattern. For short pattern strings this algorithm has about a 20 percent or greater increase in search speed for normal English text. Cole presents three different variations of this algorithm with different search orderings. No complexity results are proven, though he conjectures that the worst-case behavior is O ( n ), where n is the length of the target string.

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image Communications of the ACM
      Communications of the ACM  Volume 33, Issue 8
      Aug. 1990
      129 pages
      ISSN:0001-0782
      EISSN:1557-7317
      DOI:10.1145/79173
      Issue’s Table of Contents

      Copyright © 1990 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 August 1990

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader