function reverse_in_place(a[0..n]) for i from 0 to floor(n/2) tmp := a[i] a[i] := a[n - 1 - i] a[n - 1 -; i] := tmp