re: What's The Deal With Binary Search? VIEW POST


May I suggest adding to the article that binary search only works on sorted data? Someone trying to noodle this through from an outside perspective may struggle with understanding the algorithm if they don't start from a sorted perspective.


Hi Matt,

I agree, that would be helpful to put in the article. The classic phone book example makes it implicit (phone books are sorted) but I didn't say it explicitly. I'll modify the article to say it more clearly.

Thanks for the suggestion!


Code of Conduct Report abuse