before: a = 3, b = 7
after:  a = 7, b = 3
data: 22 10 15 3 8 2
after exchanging data[0] and data[5]: 2 10 15 3 8 22
