Collections

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun <T> reverse(list: MutableList<T>)
Link copied to clipboard

Returns a comparator that imposes the reverse ordering of the specified comparator. If the specified comparator is null, this method is equivalent to .reverseOrder (in other words, it returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the Comparable interface).

Link copied to clipboard
fun <T> swap(list: MutableList<T>, i: Int, j: Int)

Swaps the elements at the specified positions in the specified list. (If the specified positions are equal, invoking this method leaves the list unchanged.)

Link copied to clipboard
Link copied to clipboard