This article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.Computer scienceWikipedia:WikiProject Computer scienceTemplate:WikiProject Computer scienceComputer science
Watson's thesis (referenced), Algorithm 4.18 is given as a generalized precursor to CW, and remark 4.20 gives its runtime as O(S*P) for text length S and max pattern length P. The final derivation of CW (Section 4.4.5) does not give a runtime. Section 13.1 claims "All of the algorithms [including CW-NORM, normal Commentz-Walter]... have worst-case running time linear in the
length of the input string. ...the running time of... CW-NORM depends (linearly...) upon the length of the shortest keyword in the keyword set." Additionally, in Section 5.1: "Although the Knuth-Morris-Pratt and Aho-Corasick algorithms have better worst-case running time than the Boyer-Moore and Commentz-Walter algorithms (respectively), the latter two algorithms are known to be extremely efficient in practice."