This is a post regarding potential ideas so no code required. I am just trying to see if I forgot some obvious solution.
Problem:
Given two strings with the same prefix and the same length:
What would be the fastest way (the least number of computational steps) to identify the length of the shared prefix between two strings. An obvious solution is to just start pairwise matching of characters until a mismatch is located. But is there a way to preprocess this particular string in order to reduce the number of pairwise comparisons. Also given a large number of such cases what would be a better solution then to just pairwise compare strings? any suggestion is more than welcomed (code not required)aaababbbababbbabababb aaababbbabaaababbabba
In reply to String matching idea by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |