|
|
|
 |
 |
 |
|
Binary Search
|
|
|  |
Contributed by Martin Maruschak
Westfield High School
Westfield, New Jersey
In preparation for looking at searches, I like to play the following game with my students. I refer to it as the "Dictionary Game." I first played it in a graduate education class. The game is played thus:
- Have the students pick any word in a standard dictionary. (Make sure you tell them to choose the main word of the article and not one of the other parts of speech or plurals.)
- Tell them that you can determine their choice in 20 yes/no questions or less.
- Start to perform a binary search.
E.g.: Is the word before page (midpoint) of the dictionary?
- You will have the word within the twenty questions. (Once you get the page number, split the columns.)
This generates many good discussions about efficiency of search methods (linear search versus binary search) and at what point 20 questions would not be enough with a binary search.
In some classes, it may be a good idea for the kids to try to guess a word in 20 questions before you do it. They will typically try to narrow down parts of speech and ask for specific words.
Contribute
If you would like to contribute other suggestions for teaching about searching, please submit your ideas.
|
|
|
|
|
|