Binary Searching Of Arrays

Another way of searching large arrays in a more effective/efficient way is to do a binary search.

How does this work different that the methods from the Find Elements program?  Those other methods load all of the array elements in memory and then perform searches. As you can imagine this put quite the workload on the computer and possibly have out of memory exceptions depending on your environment.

With a binary search it basically uses an algorithm takes small chunks of the array, loads them in memory, and searches thru that. This method only has a benefit on large arrays. The typical rule is if the array is over 100 elements use this method. Otherwise use the more linear approaches from the other methods.

Continue reading