swap method

void swap(
  1. int first,
  2. int second
)

Implementation

void swap(int first, int second) {
  final temp = this[first];
  this[first] = this[second];
  this[second] = temp;
}