Posts Tagged ‘binary’

AS3 Binary Search

October 13, 2009Danwize 4 Comments »

Here is a simple recursive binary search function written in AS3.  This is a quick and efficient way to search an array.  In the worst case, binary search will take log2(n) steps to finish the search where n is the length of the array.  Of course this algorithm only works if the array has been sorted.  It [...]

Read More »