SearchComparator<T> extension
- on
-
- Comparator<
T>
- Comparator<
Methods
-
binarySearch(
List< T> list, T value, {int? start, int? end}) → int -
Available on Comparator<
Performs a binary search ofT> , provided by the SearchComparator extensionvalue
on the sortedlist
. Returns the index of any element that compares equal, or-1
if the value is not found. The result is undefined if the list is not sorted. -
binarySearchLower(
List< T> list, T value, {int? start, int? end}) → int -
Available on Comparator<
Performs a binary search ofT> , provided by the SearchComparator extensionvalue
on the sortedlist
. Returns the the first suitable insertion index such thatlist[index - 1] < value <= list[index]
(lower bound). The result is undefined if the list is not sorted. -
binarySearchUpper(
List< T> list, T value, {int? start, int? end}) → int -
Available on Comparator<
Performs a binary search ofT> , provided by the SearchComparator extensionvalue
on the sortedlist
. Returns the the last suitable insertion index such thatlist[index - 1] <= value < list[index]
(upper bound). The result is undefined if the list is not sorted.