lowerBound<T> function
Implementation
int lowerBound<T>( List<T> array, T value, Comparator comparator) {
int first = 0;
int count = array.length;
while (count > 0) {
int step = ((count / 2).truncate() | 0);
int it = first + step;
if ( comparator(array[it], value) <= 0) {
first = ++it;
count -= step + 1;
} else {
count = step;
}
}
return first;
}