cpp implementation of Reverse Linked List II