dart.pkg.collection.algorithms library Null safety

Import collection.dart instead.

Functions

binarySearch<T>(List<T> sortedList, T value, {int compare(T, T)}) int
Returns a position of the value in sortedList, if it is there. [...]
insertionSort<T>(List<T> list, {int compare(T, T), int start: 0, int? end}) → void
Sort a list between start (inclusive) and end (exclusive) using insertion sort. [...]
lowerBound<T>(List<T> sortedList, T value, {int compare(T, T)}) int
Returns the first position in sortedList that does not compare less than value. [...]
mergeSort<T>(List<T> list, {int start: 0, int? end, int compare(T, T)}) → void
Sorts a list between start (inclusive) and end (exclusive) using the merge sort algorithm. [...]
reverse(List list, [int start = 0, int? end]) → void
Reverses a list, or a part of a list, in-place.
shuffle(List list, [int start = 0, int? end]) → void
Shuffles a list randomly. [...]