R
Roedy Green
Let's say I had a million records each with a text field. I wanted to
find all records that contained a given substring. Are there fast
algorithms to do that or do you have to scan the whole thing linearly?
I imagine you could build an index of words. Then maybe you could
figure out which words contain the string, and narrow your search to
records with those words.
Similarly, I was wondering how you might build an index to all the
files on a computer so that you could find one just by giving a wild
card or partial filename.
--
Roedy Green Canadian Mind Products
http://mindprod.com
For me, the appeal of computer programming is that
even though I am quite a klutz,
I can still produce something, in a sense
perfect, because the computer gives me as many
chances as I please to get it right.
find all records that contained a given substring. Are there fast
algorithms to do that or do you have to scan the whole thing linearly?
I imagine you could build an index of words. Then maybe you could
figure out which words contain the string, and narrow your search to
records with those words.
Similarly, I was wondering how you might build an index to all the
files on a computer so that you could find one just by giving a wild
card or partial filename.
--
Roedy Green Canadian Mind Products
http://mindprod.com
For me, the appeal of computer programming is that
even though I am quite a klutz,
I can still produce something, in a sense
perfect, because the computer gives me as many
chances as I please to get it right.