swap nodes at k & n-k using only pointers