COMPUTE-PREFIX-FUNCTION takes O(m) and two loops both of which are O(m). Therefore, COMPUTE-GOOD-SUFFIX-FUNCTION is O(m)