O(log n) algorithms for bound searches