It should be O(n) in suffix tree. It uses succinct format to do recording, so even if there could be O(n^2) results, to get the number of distinct substring, it's linear.
【在 x***y 的大作中提到】 : It should be O(n) in suffix tree. It uses succinct format to do recording, : so even if there could be O(n^2) results, to get the number of distinct : substring, it's linear.