drbitboy
Lifetime Supporting Member
Binary search easily completes in one scan and will typically be the most efficient solution to determining whether a given value is in a list of other numbers. That said, it is still slower than array of Bools, or 32 32-bit integers, with bits sets at prime offsets.
Maximum total scan time when doing the binary search is 2.6-3ms on MicroLogix 1100, where a minimum scan cycle, i.e. doing nothing other than overhead, is 0.7-1.2ms.
Maximum total scan time when doing the binary search is 2.6-3ms on MicroLogix 1100, where a minimum scan cycle, i.e. doing nothing other than overhead, is 0.7-1.2ms.