public Node swapPairs(Node head) {
if(head==null || head.next==null)
return head;
Node first=head;
Node second=head.next;
first.next=second.next;
second.next=first;
head=second;
Node prev=first;
first=first.next;
while(first!=null && first.next!=null)
{
second=first.next;
first.next=second.next;
second.next=first;
prev.next=second;
prev=first;
first=first.next;
}
return head;
}