I have a nice way to describe the binary search algorithm that is older-relative tested. How do you go about finding a particular card in a deck of 52 cards? Of course you flip through them one by one, and darn it if the card you’re looking for isn’t second to the last. If you have to find a single card often, you will quickly get tired of this. A better method would be to sort the cards in some predictable, understandable order. Then, when you need to find a certain card you divide the deck in half and see which half is closer to your card, then divide that pile in half and so on and so forth until you find it. In the worst case, you’ll only have to look at 7 cards. The beautiful thing is that if you doubled the number of cards, you’d only have to check your sorted deck one additional time. In a sorted deck of 8,000 unique cards, you’d only have to check 14 cards to find the one you’re looking for.
I mention this because I just posted a VB.NET class to look up IP addresses which would have been impractical without Array.BinarySearch. Enjoy.

