make it clear this way:
1) temp1 & temp2: initialized
2) Then pair comparation。For instance, a1&an, a2&an-2…ai&an-1 n/2 times
3) when each pair comparation ,if the larger >temp1,->temp1,n/2 times; if the smaller <temp2,->temp2,n/2 times;
so total=3/2n