This directory contains the code for the suffix tree algorithm
described in the following paper:

Julian Shun and Guy Blelloch, A Simple Parallel Cartesian Tree
Algorithm and its Application to Parallel Suffix Tree Construction,
Transactions on Parallel Computing, 2014 (earlier version appears in
ALENEX 2011).

COMPILATION:
These are the following executables that can be generated by "make":

suffixArray
suffixTree

The code can be compiled with cilk++, icpc, openMP, or g++. To compile
with cilk++, icpc or OpenMP set the appropriate environment variable
as indicated in the Makefile. By default the code will be compiled
with g++. To use long integers instead of integers, define the
environment variable "LONG" before compiling (i.e. "export LONG=1").

"make suffixArray" generates the suffixArray executable
"make suffixTree" generates the suffixTree executable  
"make all" generates both the suffixArray and suffixTree executables.
"make clean" removes the executables and object files.

USAGE: suffixArray: Takes the file name as an argument
(e.g. "./suffixArray filename") and returns the suffix array for that
file.

suffixTree: Takes the file name as the first argument. To search for a
string pass the flag "-s" followed by the search string. To search for
n/20 random substrings from the input file in the suffix tree, pass
the flag "-c". It returns the suffix tree for the file as well as the
position of the search string (if entered) in the suffix tree if it is
found.

For both programs, the input file should be null-terminated.