dart.pkg.collection.algorithms library

Import collection.dart instead.

Functions

binarySearch<T>(List<T> sortedList, T value, {int compare(T a, T b)}) int
Returns a position of the value in sortedList, if it is there. [...]
insertionSort<T>(List<T> list, {int compare(T a, T b), 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 a, T b)}) 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 a, T b)}) → 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. [...]