binarySearch method
Returns the index of element in this sorted list via binary search.
element: The target element to search for.compare: Custom comparison function returning negative, zero, or positive.
Requires:
- The underlying list MUST be sorted according to
compare.
Ensures:
- Returns the zero-based index of
elementin O(log N), or negative value if not found.
Implementation
Bloom<int> binarySearch(E element, int Function(E a, E b) compare) =>
computed((via) =>
col.ListExtensions(via(_listBloom)).binarySearch(element, compare));