There is no swap method included, while you use swap(headA, headB).
There is no swap method included, while you use swap(headA, headB).