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 in sortedList, 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) and end (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 than value.
mergeSort<E>(List<E> elements, {int start = 0, int? end, int compare(E, E)?}) → void
Sorts a list between start (inclusive) and end (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.