首页 | 本学科首页   官方微博 | 高级检索  
     检索      


An O(n log n) algorithm for finding all repetitions in a string
Authors:Michael G Main  Richard J Lorentz
Institution:Department of Computer Science, University of Colorado, Boulder, Colorado 80309 USA;Computer Science Group, Harvey Mudd College, Claremont, California 91711 USA
Abstract:Any nonempty string of the form xx is called a repetition. An O(n log n) algorithm is presented to find all repetitions in a string of lenght n. The algorithm is based on a linear algorithm to find all the new repetitions formed when two strings are concatenated. This linear algorithm is possible because new repetitions of equal length must occur in blocks with consecutive starting positions. The linear algorithm uses a variation of the Knuth-Morris-Pratt algorithm to find all partial occurrences of a pattern within a text string. It is also shown that no algorithm based on comparisons of symbols can improve O(n log n). Finally, some open problems and applications are suggested.
Keywords:
本文献已被 ScienceDirect 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号