I came across below program which looks perfect. Per me its time complexity is nlogn where n is the length of String.
n for storing different strings,nlog for sortin
Have a look at this algorithm given in geeksforgeeks, this might be helpful:
http://www.geeksforgeeks.org/suffix-tree-application-3-longest-repeated-substring/