With amortized analysis, can show that computing the prefix-function is O(m).
For more informaiton, see pp 871-874.