dart.pkg.collection.algorithms library Null safety
Import collection.dart
instead.
Functions
-
binarySearch<
E> (List< E> sortedList, E value, {int compare(E, E)?}) → int -
Returns a position of the
value
insortedList
, if it is there. -
insertionSort<
E> (List< E> elements, {int compare(E, E)?, int start = 0, int? end}) → void -
Sort a list between
start
(inclusive) andend
(exclusive) using insertion sort. -
lowerBound<
E> (List< E> sortedList, E value, {int compare(E, E)?}) → int -
Returns the first position in
sortedList
that does not compare less thanvalue
. -
mergeSort<
E> (List< E> elements, {int start = 0, int? end, int compare(E, E)?}) → void -
Sorts a list between
start
(inclusive) andend
(exclusive) using the merge sort algorithm. -
reverse<
E> (List< E> elements, [int start = 0, int? end]) → void - Reverses a list, or a part of a list, in-place.
-
shuffle(
List elements, [int start = 0, int? end, Random? random]) → void - Shuffles a list randomly.