lewist57
Newcomer
First of all, let me apologize for asking such a simplistic question, but here goes.
Suppose one wants to search an array of 100 strings, for three words. The search for the words is conducted one at a time (word 1, word 2 and then word 3). And the words are exclusive, in that only one of the three words will appear only once in a line, if at all (ie - no line will have more than one of the words in it). In searching through the array for the first word, suppose you find it in 23 lines. Now, if a word is found in a string, that string does not need to be searched again, so when searching for the second word, one would search through 77 strings (100 - 23). And if you found the second word in 40 strings, then you would want to search only the remaining 37 (77 - 40) strings for the 3rd word.
One could simply search through all 100 strings each time a word is being searched for, but is there a clean and efficient way to avoid searching strings that have already been identified as containing other search words? Although this sounds trivial, for my purposes, my array could approach 10,000 strings, so every little bit helps.
Thanks in advance for your input
Suppose one wants to search an array of 100 strings, for three words. The search for the words is conducted one at a time (word 1, word 2 and then word 3). And the words are exclusive, in that only one of the three words will appear only once in a line, if at all (ie - no line will have more than one of the words in it). In searching through the array for the first word, suppose you find it in 23 lines. Now, if a word is found in a string, that string does not need to be searched again, so when searching for the second word, one would search through 77 strings (100 - 23). And if you found the second word in 40 strings, then you would want to search only the remaining 37 (77 - 40) strings for the 3rd word.
One could simply search through all 100 strings each time a word is being searched for, but is there a clean and efficient way to avoid searching strings that have already been identified as containing other search words? Although this sounds trivial, for my purposes, my array could approach 10,000 strings, so every little bit helps.
Thanks in advance for your input