insortLeft method
- E element,
- {int compare(
- E,
- E
- int low,
- int high}
Inserts an element
to a sorted list
while keeping it sorted,
assuming this list
is already sorted.
If the element
is already on this list
, it is inserted in the
leftmost possible position.
Optional parameters works the same as in bisectLeft
.
Equivalent to:
list.insert(list.bisectLeft(element), element)
Implementation
void insortLeft(E element, {int Function(E, E) compare, int low, int high}) {
low = bisectLeft(element, compare: compare, low: low, high: high);
insert(low, element);
}