HackerPapers

arXiv:1509.09228cs.DS

Fast Algorithms for Exact String Matching

Srikrishnan Divakaran

HN submission. Found in a submission link or body. Submitters do not count as commenters in the main ranking; a submission is not an endorsement.

Abstract

Given a pattern string $P$ of length $n$ and a query string $T$ of length $m$, where the characters of $P$ and $T$ are drawn from an alphabet of size $Δ$, the {\em exact string matching} problem consists of finding all occurrences of $P$ in $T$. For this problem, we present algorithms that in $O(nΔ^2)$ time pre-process $P$ to essentially identify $sparse(P)$, a rarely occurring substring of $P$, and then use it to find occurrences of $P$ in $T$ efficiently. Our algorithms require a worst case search time of $O(m)$, and expected search time of $O(m/min(|sparse(P)|, Δ))$, where $|sparse(P)|$ is at least $δ$ (i.e. the number of distinct characters in $P$), and for most pattern strings it is observed to be $Ω(n^{1/2})$.

arXiv comments
Journal reference
DOI
Subjects
cs.DSData Structures and Algorithms

On Hacker News

No comments linking this paper were found in the collected sources. Found in 2 HN submissions from Oct 2015 to Oct 2015. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments0 threads

No comments linking this paper were found in the collected sources. Open submission discussions.

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.