Enhanced Two Sliding Windows Algorithm For Pattern Matching (ETSW)
Mariam Itriq, Amjad A. Hudaib, Aseel Al-Anani, Rola Al-Khalid, Dima Suleiman, King Abdullah · 2012
In this paper, we propose a string matching algorithm - Enhanced Two Sliding Windows (ETSW), which made an improvement on the Two Sliding Windows algorithm (TSW). The TSW algorithm scans the text from both sides simultaneously using two sliding windows. The ETSW algorithm enhances the TSW's process by utilizing the idea of the two sliding windows and focusing on making comparisons with the pattern from both sides simultaneously. The comparisons done between the text and the pattern are done from both sides in parallel. The experimental results show that the ETSW algorithm has enhanced the process of pattern matching by reducing the number of comparisons performed. The best time case is calculated and found to be while the average case time complexity , where m is the pattern length and n in the text length.