O(n)
1 article · search the full text for this term
-
Searching Substring in O(n) Time Complexity
Abstract: This research paper presents a highly efficient algorithm for substring search within a given string, achieving a remarkable time complexity of O(n). The proposed algorithm utilizes a two-pointer approach to compare the given string with the targeted substring. By employing string concatenation, the algorithm dynamically constructs a resultant substring during the matching process. Upon completion of character matching, the algorithm compares the resultant substring with the targeted substring and returns …
Published in International Journal of Algorithms Design and Analysis Review · Vol. 1, Issue 1, 2023 · pp. 9–15 Read article