Substring Search
When you’re working on your code in your text editor and you need to find the variable doris_the_cat somewhere within thousands of lines of code, it’s unlikely you’ll go scrolling down the code until the variable catches your eye. Instead, you’ll probably use your text editor’s “find” feature, in which you’ll enter doris_the_cat, or just doris, and your editor will immediately put the first instance of that variable in view. While most of us take this feature for granted, it’s not at all trivial to find the string doris_the_cat amid thousands of lines of code so quickly.
This problem is known as substring search. That is, we have some large body of text (such as a code file), and a smaller string (such as doris_the_cat), and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access