Ukkonen-s-Suffix-Tree-Algorithm
Ukkonen-s-Suffix-Tree-Algorithm copied to clipboard
O(n^2) time complexity due to list copy
There is a copy of list in unfold function. It leads to O(len(remains)) time complexity for this operation. And due to being inside while remainder > 0 this gains O(n^2) time complexity for the whole implementation (e.g. for "aaaaab").