recursive compare of linked list