adding iterative solution to inplace linked list reversal