The Beauty of Binary Searches

Originally published at: The Beauty of Binary Searches – Xojo Programming Blog

Problem: you need to search an array to see if it contains a particular value. The simple solution is IndexOf if it’s a simple array, or a loop like this: for each item as ArrayType in myArray if item.Matches( myValue ) then YesSiree( myValue ) exit end if next That’s pretty easy, but what if the array…

3 Likes