bisect library

Constants

bisect → const int Function<E>(List<E> a, E x, {Comparator<E>? compare, int? hi, ToKey<E, Object>? key, int lo = 0})
Same as bisect_right.
insort → const void Function<E>(List<E> a, E x, {Comparator<E>? compare, int? hi, ToKey<E, Object>? key, int lo = 0})
Same as insort_right.

Functions

bisect_left<E>(List<E> a, E x, {int lo = 0, int? hi, ToKey<E, Object>? key, Comparator<E>? compare}) int
Locate the insertion point for x in a to maintain sorted order. The parameters lo and hi may be used to specify a subset of the list which should be considered; by default the entire list is used. If x is already present in a, the insertion point will be before (to the left of) any existing entries. The return value is suitable for use as the first parameter to List.insert assuming that a is already sorted.
bisect_right<E>(List<E> a, E x, {int lo = 0, int? hi, ToKey<E, Object>? key, Comparator<E>? compare}) int
Similar to bisect_left, but returns an insertion point which comes after (to the right of) any existing entries of x in a.
find_ge<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key}) → E
Find leftmost item greater than or equal to x
find_gt<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key}) → E
Find leftmost value greater than x
find_le<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key}) → E
Find rightmost value less than or equal to x
find_lt<E>(List<E> a, E x, {Comparator<E>? compare}) → E
Find rightmost value less than x
index<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key, int lo = 0, int? hi}) int?
Locate the leftmost value exactly equal to x
insort_left<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key, int lo = 0, int? hi}) → void
Assuming the list is sorted, insert item in list in sorted order.
insort_right<E>(List<E> a, E x, {Comparator<E>? compare, ToKey<E, Object>? key, int lo = 0, int? hi}) → void
Similar to insort_left, but inserting item in list after any existing entries of item.