Pointer swap in stack sort method.