public class LRS
extends java.lang.Object
Compilation: javac LRS.java
Execution: java LRS < file.txt
Dependencies: StdIn.java SuffixArray.java
Data files: http://algs4.cs.princeton.edu/63suffix/tinyTale.txt
http://algs4.cs.princeton.edu/63suffix/mobydick.txt
Reads a text string from stdin, replaces all consecutive blocks of
whitespace with a single space, and then computes the longest
repeated substring in that text using a suffix array.
% java LRS < tinyTale.txt
'st of times it was the '
% java LRS < mobydick.txt
',- Such a funny, sporty, gamy, jesty, joky, hoky-poky lad, is the Ocean, oh! Th'
% java LRS
aaaaaaaaa
'aaaaaaaa'
% java LRS
abcdefg
''