Not getting correct output

debug your code for
6
2 4 1 3 6 8
the correct output shd be
1 3 2 4 6 8