Performance Comparison of Different Code Implementations of the KMP Algorithm
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.
References
- Knuth, D. E. The Art of Computer Programming, Volume 3: Sorting and Searching. Addison-Wesley, 1973.
- 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.
- Morris, J.H., and Pratt, V.R. "A Linear Pattern-Matching Algorithm." University of California, Berkeley, 1970.
- 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.
- Wei, Sun. "A New Improved KMP Algorithm." Mathematics in Practice and Theory, 2012.
- Cao, Panwei, and Suping Wu. "Parallel Research on KMP Algorithm." 2011 International Conference on Consumer Electronics, Communications and Networks (CECNet), 2011, pp. 4252-4255.
- Park, Neungsoo, Soeun Park, and Myungho Lee. "High Performance Parallel KMP Algorithm on a Heterogeneous Architecture." Cluster Computing, vol. 23, 2018, pp. 2205-2217.
- Yao, Xiuqing. "On the Improvement of KMP Algorithm." Digital Technology & Application, vol. 38, no. 4, 2020, pp. 102-103.
- Li, Li, et al. "Improved Algorithm KMPP Based on KMP." Computer Engineering and Applications, vol. 52, no. 8, 2016, pp. 33-37.
- Ma, Ruiyan. "Optimization and Application of KMP Algorithm." Computer Knowledge and Technology, vol. 19, no. 20, 2023, pp. 73-75.