Basically you start in the middle of the array, compare your search value with the middle element, and if larger, search in the second half of the array. If smaller, search in the first half of the array.
In reply to Re: find closest element of array without going over
by moritz
in thread find closest element of array without going over
by sadfaceman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |