Java Utililty Methods ArrayList Swap

List of utility methods to do ArrayList Swap

Description

The list of methods to do ArrayList Swap are organized into topic(s).

Method

voidswap(ArrayList numbers, int i, int j)
swap
int temp = numbers.get(i);
numbers.set(i, numbers.get(j));
numbers.set(j, temp);
voidswap(ArrayList dataStrs, int i, int j)
swap
String temp = dataStrs.get(i);
dataStrs.set(i, dataStrs.get(j));
dataStrs.set(j, temp);
voidswap(ArrayList data, int i, int j)
Swap two values in an object array.
T tmp = data.get(i);
data.set(i, data.get(j));
data.set(j, tmp);
EswapRemove(ArrayList list, int index)
swap Remove
if (list.size() > 1) {
    list.set(index, list.get(list.size() - 1));
return list.remove(list.size() - 1);