Longest repeated substring is an application of suffix tree.
Read more about it at
http://www.allisons.org/ll/AlgDS/Tree/Suffix/LOngest sorted substring is indicated by the
deepest fork node in the suffix tree, where
depth is measured by the number of
characters traversed from the root.
Time complexity : O(n)
--
Shishir Mittal
Ph: +91 9936 180 121