Performance Comparison of Different Code Implementations of the KMP Algorithm
- 1 Nanjing Foreign language School Xianlin Campus, Nanjing, Jiangsu, China, 210000
* Author to whom correspondence should be addressed.
Abstract
This paper presents a performance comparison of diverse implementations of the KMP algorithm, a widely employed string matching technique for efficiently searching patterns in text. The study evaluates the time complexity, space complexity, and execution efficiency of different code versions. Key findings are derived from a review of relevant literature, focusing on advantages and challenges of various implementations. The experimental setup and performance metrics are described, comparing time and space usage across different implementations. The results are interpreted, discussing the significance of selecting the appropriate implementation for specific applications. The paper concludes with recommendations for future research and potential optimizations.
Keywords
KMP algorithm, Code implementation, Performance comparison, Time complexity, Space complexity
[1]. Knuth, D. E. The Art of Computer Programming, Volume 3: Sorting and Searching. Addison-Wesley, 1973.
[2]. Knuth, D.E., Morris, J.H., and Pratt, V.R. "Fast Pattern Matching in Strings." SIAM Journal on Computing, vol. 6, no. 2, 1977, pp. 323-350.
[3]. Morris, J.H., and Pratt, V.R. "A Linear Pattern-Matching Algorithm." University of California, Berkeley, 1970.
[4]. Lu, Xiangyu. "The Analysis of KMP Algorithm and Its Optimization." Journal of Physics: Conference Series, vol. 1345, 2019, pp. 1-5, doi:10.1088/1742-6596/1345/4/042005.
[5]. Wei, Sun. "A New Improved KMP Algorithm." Mathematics in Practice and Theory, 2012.
[6]. Cao, Panwei, and Suping Wu. "Parallel Research on KMP Algorithm." 2011 International Conference on Consumer Electronics, Communications and Networks (CECNet), 2011, pp. 4252-4255.
[7]. Park, Neungsoo, Soeun Park, and Myungho Lee. "High Performance Parallel KMP Algorithm on a Heterogeneous Architecture." Cluster Computing, vol. 23, 2018, pp. 2205-2217.
[8]. Yao, Xiuqing. "On the Improvement of KMP Algorithm." Digital Technology & Application, vol. 38, no. 4, 2020, pp. 102-103.
[9]. Li, Li, et al. "Improved Algorithm KMPP Based on KMP." Computer Engineering and Applications, vol. 52, no. 8, 2016, pp. 33-37.
[10]. Ma, Ruiyan. "Optimization and Application of KMP Algorithm." Computer Knowledge and Technology, vol. 19, no. 20, 2023, pp. 73-75.
Cite this article
Tan,J. (2024). Performance Comparison of Different Code Implementations of the KMP Algorithm. Applied and Computational Engineering,115,8-15.
Data availability
The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.
Disclaimer/Publisher's Note
The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
About volume
Volume title: Proceedings of the 5th International Conference on Signal Processing and Machine Learning
© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and
conditions of the Creative Commons Attribution (CC BY) license. Authors who
publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons
Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this
series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published
version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial
publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and
during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See
Open access policy for details).