The Numbers Game: Binary Search

The binary search technique is used when the problem location is known, but there are many subsystems to choose from. Remember, usually only one root cause exists at a time, and when the problem has already been localized, binary search is a quick way of finding that needle in a haystack.

For example, let’s say that I’m thinking of a number from one to one million, and you want to guess what that number is. If you proceed sequentially and guess every number, you could potentially go through 999,999 numbers before getting it right. However, if you divide the maximum number in half, and I tell you “higher” or “lower,” and you keep dividing that result in half, you will take at most only 20 guesses. Yup, just 20. ...

Get Sams Teach Yourself Network Troubleshooting in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.