\documentclass{article} \usepackage{me} \setlength{\parindent}{0pt}

This material takes about 1.5 hours.

Suffix Trees

Gusfield: Algorithms on Strings, Trees, and Sequences.

Weiner 73 “Linear Pattern-matching algorithms” IEEE conference on automata and switching theory

McCreight 76 “A space-economical suffix tree construction algorithm” JACM 23(2) 1976

Chen and Seifras 85 “Efficient and Elegegant Suffix tree construction” in Apostolico/Galil Combninatorial Algorithms on Words

Another “search” structure, dedicated to strings.

Basic problem: match a “pattern” (of length $m$) to “text” (of length $n$)

First idea: binary tree on strings. Inefficient because run over pattern many times.

Tries:

But what about substrings?

Better construction:

Suffix links:

Memoizing: (save your work)

half hour up to here.

Amortization key principles:

Linear-size structure:

Search still works:

Construction:

MacReight 1976

Amortized Analysis:

Analysis:

Weiner algorithm: insert strings “backwards”, use prefix links.

Ukonnen online version.

Suffix arrays: many of same benefits as suffix trees, but save pointers:

Applications: