Linked list basic operations and pair wise swap solution