swap

fun swap(index1: Int, index2: Int)

Swap the items at indices index1 and index2.

Throws

if either index is out of bounds.