Swap Nodes in Pairs(linked list)
Given a linked list, swap every two adjacent nodes and return its head.
Example:
分析
prev=dummy, prev之后的cur 和next互换 prev别动。 完了prev=cur cur= cur.next
Last updated
Given a linked list, swap every two adjacent nodes and return its head.
Example:
分析
prev=dummy, prev之后的cur 和next互换 prev别动。 完了prev=cur cur= cur.next
Last updated