In python:
array[index_1], arrray[index_2] = array[index_2], array[index_1]
In general:
SET tmp TO array[index_1]
SET array[index_1] TO array[index_2]
SET array[index_2] TO tmp
5 3 9 4 2 6 1
5 3 9|4 2 6 1
5|3 9|4 2|6 1
5|3|9|4|2|6|1
5|3 9|2 4|1 6
3 5 9|1 2 4 6
1 2 3 4 5 6 9