prev to None and cur to head.cur reaches the leftth node, updating prev and cur.con (the node before left) and tail (the leftth node).left to right, reversing the links by pointing cur.next to prev.prev and cur to the next nodes in the list.con and tail.con is not None, point con.next to prev, otherwise set head to prev.tail.next to cur to connect the end of the reversed sublist to the remaining list.