in reply to Re^2: Check word presence WITHOUT hashes or grep
in thread Check word presence WITHOUT hashes or grep
Binary search is the process where you halve the remaining search space for each test. So, lets say you have your dictionary of say 100.000 words in a SORTED array. Now you want to test if the word Trzagrat is in there somewhere. First you look on the position in the middle of your dictionary array. Either you find the word there, or if not, you will know which half of the dictionary must hold the word if it's there at all, because the dictionary is sorted, and the word you're looking up either sorts before or after the word you found at this position. So you contiune...
A better explanation on Wikipedia, binary search
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Check word presence WITHOUT hashes or grep
by gojippo (Novice) on Apr 30, 2008 at 07:16 UTC | |
by GrandFather (Saint) on Apr 30, 2008 at 08:37 UTC | |
by stiller (Friar) on Apr 30, 2008 at 07:51 UTC |